ale icon indicating copy to clipboard operation
ale copied to clipboard

lint on Fucus gained

Open mkarpoff opened this issue 9 years ago • 4 comments

Is there an easy way to make ALE run the linter when the buffer regains focus? I've been trying to do this with auto commands with little success.

mkarpoff avatar Jun 23 '17 14:06 mkarpoff

It's not so easy. I used to do this, but you run into problems like checking a buffer for problems after focusing a window after having left a quickfix window you just closed, when in turn opens the quickfix window again. You shouldn't have to check a buffer for problems after you bring it into focus. Checking when a buffer is created, read, saved, or edited should be enough.

w0rp avatar Jun 23 '17 14:06 w0rp

That makes allot of sense. I was looking for this because if I fix something in another split view buffer (example a bug in a C/C++ header file) and a source file found the bug it would detect the fix in the source file until I wrote to it or edited it. That being said it sounds like manually triggering the lint is better.

mkarpoff avatar Jun 23 '17 15:06 mkarpoff

It might be possible to support this by using the FileChangedShellPost command to detect if a buffer is changed, and then check a buffer on BufEnter based on a flag being set.

w0rp avatar Jun 23 '17 16:06 w0rp

Now files will be checked on enter if they have been changed outside of Vim. (Or straight away if that's the file you have open.)

w0rp avatar Jun 24 '17 11:06 w0rp