Closed zmstone closed 7 years ago
Does this differ from :lnext
?
No. Apparently I didn't know about lne and lp.
@hcs42 :lnext skips over warnings, and echos 'No error' when there is only warning. I checked doc, there is no mentioning about a config to hide warnings etc.
Maybe there is another vim feature that I don't know of ?
It doesn't skip warnings for me, but I might know what is confusing.
E.g. I have this file and save it:
-module(x).
-export([]).
f() ->
ok.
g() ->
ok.
z() ->
1
I get the problematic lines highlighted.
If I type :lopen
, I can see the list of errors/warnings:
/home/hcs/_/2017_01_16/x.erl|11| syntax error before:
/home/hcs/_/2017_01_16/x.erl|4 warning| function f/0 is unused
/home/hcs/_/2017_01_16/x.erl|7 warning| function g/0 is unused
Now my screen looks like this:
:lfirst
jumps to the first entry (which is the error in line 11), then :lnext
jumps to the second entry (which is the warning in line 4).
So if there are both errors and warnings, the Erlang compiler will print all errors first and only then does it print the warnings.
Notes:
:lnext
will jump between the warnings.:make
to compile the module, then you need :cfirst
, :cnext
, :copen
, etc. to navigate between those errors/warnings.Does any of this explain what's happening on your machine? If not, could you describe how Vim behaves when saving the file above? (Maybe also add a screenshot?)
Thanks for the very detailed info.
In my case: All warnings and errors are highlighted in the sidebar. and :lopen lists all errors and warnings. Only :lnext skips over the warning and echos 'No error' when there is only Warning
I'm using neovim 0.1.7, have not tried it in vim. I guess this is very likely a problem of neovim specific setting. ... or a neovim bug.
Thanks for your time.
Add a function to help move cursor to the next error. The users can add their key bindings or user-defined command to jump to the next error line for easier motion.