Add prompt option

This commit is contained in:
haya14busa 2014-01-14 06:29:36 +09:00
parent 008498ae4b
commit 7ab69a7dc2
2 changed files with 8 additions and 4 deletions

View File

@ -411,15 +411,17 @@ function! s:GetChar() " {{{
endfunction " }}}
function! s:InputPrompt(message, input) "{{{
redraw
echohl Question
echo a:message ': ' . a:input
echohl None
echohl Question | echon a:message | echohl None
echon a:input
endfunction "}}}
function! s:GetInput(num_strokes) "{{{
let input = ''
" repeat a:num_strokes times
while s:strchars(input) < a:num_strokes
call s:InputPrompt('Input', input)
" if a:num_strokes > 1 && g:EasyMotion_show_prompt
if g:EasyMotion_show_prompt
call s:InputPrompt(g:EasyMotion_prompt, input)
endif
let c = getchar()
let char = type(c) == type(0) ? nr2char(c) : c
if char ==# "\<Esc>" || char2nr(char) == 128

View File

@ -31,6 +31,8 @@ let g:EasyMotion_skipfoldedline = get(g: , 'EasyMotion_skipfoldedline' ,
let g:EasyMotion_use_migemo = get(g: , 'EasyMotion_use_migemo' , 0)
let g:EasyMotion_use_upper = get(g: , 'EasyMotion_use_upper' , 0)
let g:EasyMotion_enter_jump_first = get(g: , 'EasyMotion_enter_jump_first' , 0)
let g:EasyMotion_show_prompt = get(g: , 'EasyMotion_show_prompt' , 1)
let g:EasyMotion_prompt = get(g: , 'EasyMotion_prompt' , '> ')
"}}}
" -- Default highlighting ---------------- {{{