commit
c9cc9ecd64
@ -391,7 +391,13 @@ endfunction " }}}
|
||||
" Helper Functions: {{{
|
||||
" -- Message -----------------------------
|
||||
function! s:Message(message) " {{{
|
||||
if g:EasyMotion_verbose
|
||||
echo 'EasyMotion: ' . a:message
|
||||
else
|
||||
" Make the current message dissapear
|
||||
echo ''
|
||||
" redraw
|
||||
endif
|
||||
endfunction " }}}
|
||||
function! s:Prompt(message) " {{{
|
||||
echohl Question
|
||||
@ -1517,7 +1523,8 @@ function! s:EasyMotion(regexp, direction, visualmode, is_inclusive, ...) " {{{
|
||||
redraw
|
||||
|
||||
" Show exception message
|
||||
if g:EasyMotion_ignore_exception != 1
|
||||
" The verbose option will take precedence
|
||||
if g:EasyMotion_verbose == 1 && g:EasyMotion_ignore_exception != 1
|
||||
echo v:exception
|
||||
endif
|
||||
|
||||
|
@ -206,7 +206,9 @@ function! s:Cancell() " {{{
|
||||
call EasyMotion#highlight#delete_highlight()
|
||||
call EasyMotion#helper#VarReset('&scrolloff')
|
||||
keepjumps call setpos('.', s:save_orig_pos)
|
||||
if g:EasyMotion_verbose
|
||||
echo 'EasyMotion: Cancelled'
|
||||
endif
|
||||
return ''
|
||||
endfunction " }}}
|
||||
function! s:getPromptMessage(num_strokes) "{{{
|
||||
|
@ -33,6 +33,7 @@ CONTENTS *easymotion-contents*
|
||||
EasyMotion_add_search_history ... |EasyMotion_add_search_history|
|
||||
EasyMotion_off_screen_search .... |EasyMotion_off_screen_search|
|
||||
EasyMotion_disable_two_key_combo. |EasyMotion_disable_two_key_combo|
|
||||
EasyMotion_verbose .............. |EasyMotion_verbose|
|
||||
Custom highlighting ............. |easymotion-custom-hl|
|
||||
Custom mappings ................. |easymotion-custom-mappings|
|
||||
Leader key .................. |easymotion-leader-key|
|
||||
@ -938,6 +939,16 @@ EasyMotion_disable_two_key_combo *g:EasyMotion_disable_two_key_combo*
|
||||
<
|
||||
Default: 0
|
||||
|
||||
EasyMotion_verbose *g:EasyMotion_verbose*
|
||||
|
||||
If you set this option to 0, you can disable all the messages the plugin
|
||||
creates, such as "EasyMotion: Jumping to [l,c]" and "EasyMotion:
|
||||
Cancelled".
|
||||
>
|
||||
let g:EasyMotion_verbose = 0
|
||||
<
|
||||
Default: 1
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
Custom highlighting *easymotion-custom-hl*
|
||||
|
||||
|
@ -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_force_csapprox = get(g: , 'EasyMotion_force_csapprox' , 0)
|
||||
let g:EasyMotion_show_prompt = get(g: , 'EasyMotion_show_prompt' , 1)
|
||||
let g:EasyMotion_verbose = get(g: , 'EasyMotion_verbose' , 1)
|
||||
let g:EasyMotion_prompt =
|
||||
\ get(g: , 'EasyMotion_prompt' , 'Search for {n} character(s): ')
|
||||
let g:EasyMotion_command_line_key_mappings =
|
||||
|
@ -1432,6 +1432,40 @@ describe 'Word motion'
|
||||
end
|
||||
"}}}
|
||||
end
|
||||
|
||||
describe 'Verbose'
|
||||
before
|
||||
new
|
||||
map s <Plug>(easymotion-s)
|
||||
map f <Plug>(easymotion-f)
|
||||
map F <Plug>(easymotion-F)
|
||||
map t <Plug>(easymotion-t)
|
||||
map T <Plug>(easymotion-T)
|
||||
call EasyMotion#init()
|
||||
call AddLine('some words in the sentence')
|
||||
end
|
||||
|
||||
after
|
||||
close!
|
||||
end
|
||||
|
||||
it 'Verbose global variable'
|
||||
Expect g:EasyMotion_verbose ==# 1
|
||||
end
|
||||
|
||||
it 'Turned On'
|
||||
let g:EasyMotion_verbose = 1
|
||||
let &verbosefile = tempname()
|
||||
normal sa
|
||||
" TODO: l:tmp_name_verbose should have one line
|
||||
end
|
||||
it 'Turned Off'
|
||||
let g:EasyMotion_verbose = 0
|
||||
let &verbosefile = &verbosefile
|
||||
normal s_
|
||||
" TODO: l:tmp_name_not_verbose should have no lines
|
||||
end
|
||||
end
|
||||
"}}}
|
||||
|
||||
" vim: fdm=marker:et:ts=4:sw=4:sts=4
|
||||
|
Loading…
x
Reference in New Issue
Block a user