If I have, say, 4 files open, and execute :bnext quickly several times with the location list open, I arrive at a new buffer with the location list showing errors from the first buffer still. I then see the location list get update with errors for the other buffers one after the other. However, not necessarily in the order I visited the buffers, so the final update of the location list might be to populate it with errors from some buffer _other than_ one I am now looking at.
Do you have a reliable way of repeating this bug with some example files? Buffer numbers used throughout the code to attempt to mitigate this issue.
I can't share the files I've been working on, but I'll see if I can construct some test files to reproduce
Understood. Sounds good. :+1:
Okay, so I've been working on reproducing this reliably. The problem isn't exactly as I described above; if I switch buffers twice very quickly, the problem doesn't occur, but if I switch buffers, pause a fraction of a second, and then switch buffers again, the problem does occur.
I've included some files I used to reproduce, but I suspect that the actual files are irrelevant.
To reproduce:
vim a.py b.py c.py:lopen:bnext|sleep 500m|bnextFor me, this leaves me in the buffer displaying c.py, but with the location list populated with errors from b.py
I managed to find the one line where the buffer number wasn't being used, setloclist(0, ...). I have fixed that now so the window ID for the buffer number will be used instead. Let me know if this fixes your issues.
Yep, that seems to fix it. Thanks!
Nice!
Most helpful comment
I managed to find the one line where the buffer number wasn't being used,
setloclist(0, ...). I have fixed that now so the window ID for the buffer number will be used instead. Let me know if this fixes your issues.