Ale: When switching quickly between several buffers, loc list can get populated with errors for the wrong buffer

Created on 2 Mar 2017  路  7Comments  路  Source: dense-analysis/ale

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.

bug

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.

All 7 comments

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.

ale-test.tar.gz

To reproduce:

  1. make sure pylint and flake8 are installed
  2. vim a.py b.py c.py
  3. :lopen
  4. switch back to code window
  5. :bnext|sleep 500m|bnext

For 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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kronos29296 picture kronos29296  路  4Comments

sodiumjoe picture sodiumjoe  路  4Comments

amerov picture amerov  路  4Comments

trevordmiller picture trevordmiller  路  3Comments

alexlafroscia picture alexlafroscia  路  4Comments