Fix for Crystal support#651
Conversation
w0rp
left a comment
There was a problem hiding this comment.
glob can be slow some times. I'll see if there's another way to check that later.
|
I did notice a slight hit to performance, but that was the easiest way I found to check if the file exists. Definitely open to suggestions. EDIT: Ugh, I'm stupid. Amended the prior commit (for nicer history). https://stackoverflow.com/a/3098685/1236035 |
|
Alright. Now I'm confused. WIth Wat? o_O |
| unlet s:should_lint_file_for_buffer[l:buffer] | ||
| let l:should_lint_file = 1 | ||
| " Lint files if they exist. | ||
| let l:should_lint_file = filereadable(expand('#' . l:buffer . ':p')) |
There was a problem hiding this comment.
Couldn't ALE also use temporary files in this case, like with modified files?!
There was a problem hiding this comment.
No. That's a check for linters which cannot use temporary files.
Fixes #650.
If the linter requires the target file (e.g.,
lint_fileattribute is set), skip the linting for that file if it does not yet exist. This can happen if you open vim at a location for a new file and the buffer for that file has not been written out to disk yet.Also includes a fix for Crystal compiler output defaulting to colorized output now, which should be removed for display in the vim output.