You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, this function would always set "v:errmsg" on the first
call with a given function. This is because autoloaded functions
are not defined on the first call.
A number of improvements have been made:
- a useless local function ("l:Function") is removed
- the "execute()" builtin captures the output, instead of ":redir"
- a ":try" block handles the case where a function is not defined
- a useless ":if" is removed since ":redir" always defines the var
- confusing quoting is re-written (remove double "'" chars)
Fixes: dense-analysis#3021
The following minimal configuration is necessary to reproduce this:
To reproduce the problem:
vim foo.vim
:echo v:errmsg
(you should see nothing):write
:echo v:errmsg
As you can see, ALE pollutes this variable unnecessarily.
The problem is due to this function from
autoload/ale/util.vim
:The problem is that
:silent!
still setsv:errmsg
.I recommend that this function be changed to:
Notes...
l:Function
).if
statement is useless, so it can go too (:redir
always creates the variable, so it will always exist).:redir
is passé. I think thatexecute()
should be preferred here.Let me know if you want a PR, and I'll submit one.
The text was updated successfully, but these errors were encountered: