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
Introduce verbose option #241
Conversation
@@ -399,7 +405,11 @@ function! s:Prompt(message) " {{{ | |||
echohl None | |||
endfunction " }}} | |||
function! s:Throw(message) "{{{ | |||
throw 'EasyMotion: ' . a:message | |||
if g:EasyMotion_verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if &verbose == 0
, Vim throws exceptions, so I don't want to suppress the error message.
It makes it hard to debug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, I just wanted to stop messages like 'EasyMotion: Cancelled'. Turns out there's a dead variable to do the same, I changed it to global verbose.
Thanks, I looks better than #239. |
I can write the documentation, but as for tests, how can I test for messages printed with |
@@ -53,7 +53,6 @@ function! EasyMotion#init() | |||
let s:EasyMotion_is_cancelled = 0 | |||
" 0 -> Success | |||
" 1 -> Cancel | |||
let g:EasyMotion_ignore_exception = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's my fault because I didn't write documentation for this variable, but this variable is used by https://github.com/haya14busa/vim-easyoperator-line.
Could you please reverting this line and check this var when printing exception?
If the verbose option is set, it's ok to suppress the exception regardless of this variable.
Thanks for the documentation. As for the test, only checking the global option is fine. |
Sorry about that, that variable seemed to perform the same function. I did a As for testing, I pushed my first stab at it. Still have to find how reliable |
Provide a way to silence nagging messages, more appropriate for a debug situation.
I did a grep for more instances, but I think that's the only place where it calls echo directly.
Make sure the exception is thrown, to clean up and do other things, but show the message only if the verbose option is set.
It's used in plugins.
Rebased this to the latest master, it was only a documentation update. |
I'm reaslly sorry for the late reply. It looks good to me. Thank you for the PR 👍 |
Thanks! 👍 |
Provide a way to silence nagging messages, more appropriate for a debug
situation.
You can define
let g:EasyMotion_verbose = 0
to quiet most messages. By default, the variable is set to 1 to maintain the current behaviour.This is similar to PR #239, but more aggressive, silences a lot more stuff by going directly to the source.