DamnWidget/anaconda — pull request #169 by rahul-ramadas (2014-06-01 13:44:50+00:00)
Title: In 'always' linting mode, disabling linting does not immediately get rid of existing lint marks

If Anaconda is in `always` linting mode, if you disable linting on a particular file by running the `Anaconda: Disable linting on this file` from the command-palette, the lint marks are not immediately erased. You need to perform some other action (change something, switch away and then back, etc.) for the marks to actually disappear.

This is what is happening:
1. Run the command from the command-palette.
2. First the view gets activated, causing Anaconda to send a request to the server to lint the file. Note that the view got activated before the window command ran, and hence Anaconda still thinks linting is enabled on the file.
3. Now the window command runs, disables linting on the file, and erases lint marks.
4. But shortly thereafter the response from the server arrives and Anaconda marks the lint issues again. Since it happens so fast it seems like the lint marks were never erased.
5. Now if you do something that causes the linter to run again, it will clear the lint marks.

I was wondering what the best way to fix this is. Easiest way is to just check again in the `parse_results` callback to see if linting has been disabled. Any better ideas?