New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
":silent loadview" does not suppress errors #3196
Comments
The issue title seems a bit broad. |
Doesn't seem so to me. It's one specific keyword,
|
What I mean is, are there are other cases where |
Not on my box, and I just built head.
|
Strange, actually, after waking up this morning, I can't reproduce the bug except for commands of the form
For these commands, the shell output is displayed. Then again, it's not clear to me anymore if this is a bug or intended. w.r.t. my other complaints, it looks like I forgot the If |
I'm having this as well with
|
I'm not even sure what's the problem here.
|
The problem is that silent isn't silencing the error. On Mon., 25 Jul. 2016, 10:37 pm Marco Hinz, notifications@github.com
|
You mean |
Yes. Also doesn't work for silent! The work around for shortcuts is to use the very nasty: :execute "try\n loadview\ncatch\nendtry" Which correctly silences errors. On Tue., 26 Jul. 2016, 12:09 am Marco Hinz, notifications@github.com
|
@Cypher1 It does not silence errors. It ignores exceptions, transforming errors into exceptions in process. Difference may be seen if you have some code after a error: e.g. redir => g:s | silent! execute 'echo xxx_nonexistent_var_xxx | echo 42' | redir END
echo g:s will yield two errors (E121 about not existing variable and E15 about invalid expression) and 42. redir => g:s | try | execute 'echo xxx_nonexistent_var_xxx | echo 42' | catch | endtry | redir END
echo g:s will yield nothing because E121 was transformed into an exception (and thus not printed and not captured by |
That may be, but I am in favor of it acting in the same way as vim. This On Tue., 26 Jul. 2016, 11:49 am Nikolai Aleksandrovich Pavlov, <
|
|
I used to use
I can see that there is a potential argument that it should not silence the output from running external One obvious workaround, to run the external 'grep' command with a redirection to FWIW I reverted my custom |
I'm confused by the various comments here. Are these requests for breaking compatibility with Vim, or are they bug reports about regressions? In Vim, What we can do is make |
Beg your pardon if I muddied the waters. It appears you are right and my memory was misleading me. I fired up Vim and :silent does not suppress the output of grep. I could have sworn it used to work that way for me, but perhaps I am just wrong. |
OK so basically loadview in vim doesn't report an error if the file is not found? What I had to do is to change silent loadview to silent! loadview |
This was changed in 9b1c939 to fix a coverity warning. Not to mention, it's rather dodgy to silently fail if the file can't be opened. Using #6552 changes |
As mentioned (and maybe forgotten) in Issue #2194, nvim does not respect a request to "silently" perform a command. In particular, with a nvim at HEAD installed and a blank .nvimrc, the command
will generate the output
In Vim, the behavior is to ignore a missing file whether or not
silent
is specified. This breaks the suggestion documented under:help loadview
(e.g. http://neovim.io/doc/user/starting.html#:loadview).Is there a workaround for this (besides the obvious hack of just checking for the existence of the view file, which only applies to this particular usage of the word
silent
)?Another easy way to reproduce this but is to open stock neovim and type
:silent !echo hello
The correct behavior here is to print nothing (and, in vim, possibly jumble the screen, forcing a manual redraw with
:redraw!
or<c-l>
).In neovim, the word "hello" is actually printed (although the manual redraw is still required.
The text was updated successfully, but these errors were encountered: