Introduce verbose option

Provide a way to silence nagging messages, more appropriate for a debug
situation.
This commit is contained in:
somini 2015-08-07 00:48:04 +01:00
parent a21d4474f0
commit 593479169b
2 changed files with 13 additions and 2 deletions

View File

@ -391,7 +391,13 @@ endfunction " }}}
" Helper Functions: {{{ " Helper Functions: {{{
" -- Message ----------------------------- " -- Message -----------------------------
function! s:Message(message) " {{{ function! s:Message(message) " {{{
echo 'EasyMotion: ' . a:message if g:EasyMotion_verbose
echo 'EasyMotion: ' . a:message
else
" Make the current message dissapear
echo ''
" redraw
endif
endfunction " }}} endfunction " }}}
function! s:Prompt(message) " {{{ function! s:Prompt(message) " {{{
echohl Question echohl Question
@ -399,7 +405,11 @@ function! s:Prompt(message) " {{{
echohl None echohl None
endfunction " }}} endfunction " }}}
function! s:Throw(message) "{{{ function! s:Throw(message) "{{{
throw 'EasyMotion: ' . a:message if g:EasyMotion_verbose
throw 'EasyMotion: ' . a:message
else
throw
endif
endfunction "}}} endfunction "}}}
" -- Save & Restore values --------------- " -- Save & Restore values ---------------

View File

@ -44,6 +44,7 @@ let g:EasyMotion_add_search_history = get(g: , 'EasyMotion_add_search_history' ,
let g:EasyMotion_off_screen_search = get(g: , 'EasyMotion_off_screen_search' , 1) let g:EasyMotion_off_screen_search = get(g: , 'EasyMotion_off_screen_search' , 1)
let g:EasyMotion_force_csapprox = get(g: , 'EasyMotion_force_csapprox' , 0) let g:EasyMotion_force_csapprox = get(g: , 'EasyMotion_force_csapprox' , 0)
let g:EasyMotion_show_prompt = get(g: , 'EasyMotion_show_prompt' , 1) let g:EasyMotion_show_prompt = get(g: , 'EasyMotion_show_prompt' , 1)
let g:EasyMotion_verbose = get(g: , 'EasyMotion_verbose' , 1)
let g:EasyMotion_prompt = let g:EasyMotion_prompt =
\ get(g: , 'EasyMotion_prompt' , 'Search for {n} character(s): ') \ get(g: , 'EasyMotion_prompt' , 'Search for {n} character(s): ')
let g:EasyMotion_command_line_key_mappings = let g:EasyMotion_command_line_key_mappings =