Modify condition for multi input find motion
This commit is contained in:
parent
832c496c4e
commit
4728a9dcbd
@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: autoload/EasyMotion/command_line.vim
|
" FILE: autoload/EasyMotion/command_line.vim
|
||||||
" AUTHOR: haya14busa
|
" AUTHOR: haya14busa
|
||||||
" Last Change: 14 Jan 2014.
|
" Last Change: 17 Jan 2014.
|
||||||
" License: MIT license {{{
|
" License: MIT license {{{
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
" Permission is hereby granted, free of charge, to any person obtaining
|
||||||
" a copy of this software and associated documentation files (the
|
" a copy of this software and associated documentation files (the
|
||||||
@ -42,12 +42,12 @@ endfunction " }}}
|
|||||||
|
|
||||||
function! EasyMotion#command_line#GetInput(num_strokes, ...) "{{{
|
function! EasyMotion#command_line#GetInput(num_strokes, ...) "{{{
|
||||||
let previous_input = a:0 == 1 ? a:1 : ''
|
let previous_input = a:0 == 1 ? a:1 : ''
|
||||||
|
|
||||||
let input = ''
|
let input = ''
|
||||||
" repeat a:num_strokes times
|
" repeat a:num_strokes times
|
||||||
let prompt_num = a:num_strokes < 50 ? a:num_strokes : ''
|
let prompt_num = a:num_strokes != -1 ? a:num_strokes : ''
|
||||||
let prompt = prompt_num . g:EasyMotion_prompt
|
let prompt = prompt_num . g:EasyMotion_prompt
|
||||||
while EasyMotion#helper#strchars(input) < a:num_strokes
|
while EasyMotion#helper#strchars(input) < a:num_strokes ||
|
||||||
|
\ a:num_strokes == -1
|
||||||
if g:EasyMotion_show_prompt
|
if g:EasyMotion_show_prompt
|
||||||
call s:InputPrompt(prompt, input)
|
call s:InputPrompt(prompt, input)
|
||||||
endif
|
endif
|
||||||
|
@ -139,16 +139,16 @@ call s:find_motion_map_helper({
|
|||||||
\ 'tl2' : {'fnc': 'TL', 'cnt': 2, 'direction': 0},
|
\ 'tl2' : {'fnc': 'TL', 'cnt': 2, 'direction': 0},
|
||||||
\ 'Tl2' : {'fnc': 'TL', 'cnt': 2, 'direction': 1},
|
\ 'Tl2' : {'fnc': 'TL', 'cnt': 2, 'direction': 1},
|
||||||
\
|
\
|
||||||
\ 'fn' : {'fnc': 'S' , 'cnt': 50, 'direction': 0},
|
\ 'fn' : {'fnc': 'S' , 'cnt': -1, 'direction': 0},
|
||||||
\ 'Fn' : {'fnc': 'S' , 'cnt': 50, 'direction': 1},
|
\ 'Fn' : {'fnc': 'S' , 'cnt': -1, 'direction': 1},
|
||||||
\ 'sn' : {'fnc': 'S' , 'cnt': 50, 'direction': 2},
|
\ 'sn' : {'fnc': 'S' , 'cnt': -1, 'direction': 2},
|
||||||
\ 'tn' : {'fnc': 'T' , 'cnt': 50, 'direction': 0},
|
\ 'tn' : {'fnc': 'T' , 'cnt': -1, 'direction': 0},
|
||||||
\ 'Tn' : {'fnc': 'T' , 'cnt': 50, 'direction': 1},
|
\ 'Tn' : {'fnc': 'T' , 'cnt': -1, 'direction': 1},
|
||||||
\ 'fln' : {'fnc': 'SL', 'cnt': 50, 'direction': 0},
|
\ 'fln' : {'fnc': 'SL', 'cnt': -1, 'direction': 0},
|
||||||
\ 'Fln' : {'fnc': 'SL', 'cnt': 50, 'direction': 1},
|
\ 'Fln' : {'fnc': 'SL', 'cnt': -1, 'direction': 1},
|
||||||
\ 'sln' : {'fnc': 'SL', 'cnt': 50, 'direction': 2},
|
\ 'sln' : {'fnc': 'SL', 'cnt': -1, 'direction': 2},
|
||||||
\ 'tln' : {'fnc': 'TL', 'cnt': 50, 'direction': 0},
|
\ 'tln' : {'fnc': 'TL', 'cnt': -1, 'direction': 0},
|
||||||
\ 'Tln' : {'fnc': 'TL', 'cnt': 50, 'direction': 1},
|
\ 'Tln' : {'fnc': 'TL', 'cnt': -1, 'direction': 1},
|
||||||
\ })
|
\ })
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
|
@ -122,45 +122,45 @@ describe 'Default settings'
|
|||||||
|
|
||||||
" Multi Char Find Motion: {{{
|
" Multi Char Find Motion: {{{
|
||||||
" sn
|
" sn
|
||||||
Expect maparg('<Plug>(easymotion-sn)', 'n') ==# ':<C-U>call EasyMotion#S(50,0,2)<CR>'
|
Expect maparg('<Plug>(easymotion-sn)', 'n') ==# ':<C-U>call EasyMotion#S(-1,0,2)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-sn)', 'o') ==# ':<C-U>call EasyMotion#S(50,0,2)<CR>'
|
Expect maparg('<Plug>(easymotion-sn)', 'o') ==# ':<C-U>call EasyMotion#S(-1,0,2)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-sn)', 'v') ==# '<Esc>:<C-U>call EasyMotion#S(50,1,2)<CR>'
|
Expect maparg('<Plug>(easymotion-sn)', 'v') ==# '<Esc>:<C-U>call EasyMotion#S(-1,1,2)<CR>'
|
||||||
" fn
|
" fn
|
||||||
Expect maparg('<Plug>(easymotion-fn)', 'n') ==# ':<C-U>call EasyMotion#S(50,0,0)<CR>'
|
Expect maparg('<Plug>(easymotion-fn)', 'n') ==# ':<C-U>call EasyMotion#S(-1,0,0)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-fn)', 'o') ==# ':<C-U>call EasyMotion#S(50,0,0)<CR>'
|
Expect maparg('<Plug>(easymotion-fn)', 'o') ==# ':<C-U>call EasyMotion#S(-1,0,0)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-fn)', 'v') ==# '<Esc>:<C-U>call EasyMotion#S(50,1,0)<CR>'
|
Expect maparg('<Plug>(easymotion-fn)', 'v') ==# '<Esc>:<C-U>call EasyMotion#S(-1,1,0)<CR>'
|
||||||
" Fn
|
" Fn
|
||||||
Expect maparg('<Plug>(easymotion-Fn)', 'n') ==# ':<C-U>call EasyMotion#S(50,0,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Fn)', 'n') ==# ':<C-U>call EasyMotion#S(-1,0,1)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-Fn)', 'o') ==# ':<C-U>call EasyMotion#S(50,0,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Fn)', 'o') ==# ':<C-U>call EasyMotion#S(-1,0,1)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-Fn)', 'v') ==# '<Esc>:<C-U>call EasyMotion#S(50,1,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Fn)', 'v') ==# '<Esc>:<C-U>call EasyMotion#S(-1,1,1)<CR>'
|
||||||
" tn
|
" tn
|
||||||
Expect maparg('<Plug>(easymotion-tn)', 'n') ==# ':<C-U>call EasyMotion#T(50,0,0)<CR>'
|
Expect maparg('<Plug>(easymotion-tn)', 'n') ==# ':<C-U>call EasyMotion#T(-1,0,0)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-tn)', 'o') ==# ':<C-U>call EasyMotion#T(50,0,0)<CR>'
|
Expect maparg('<Plug>(easymotion-tn)', 'o') ==# ':<C-U>call EasyMotion#T(-1,0,0)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-tn)', 'v') ==# '<Esc>:<C-U>call EasyMotion#T(50,1,0)<CR>'
|
Expect maparg('<Plug>(easymotion-tn)', 'v') ==# '<Esc>:<C-U>call EasyMotion#T(-1,1,0)<CR>'
|
||||||
" Tn
|
" Tn
|
||||||
Expect maparg('<Plug>(easymotion-Tn)', 'n') ==# ':<C-U>call EasyMotion#T(50,0,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Tn)', 'n') ==# ':<C-U>call EasyMotion#T(-1,0,1)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-Tn)', 'o') ==# ':<C-U>call EasyMotion#T(50,0,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Tn)', 'o') ==# ':<C-U>call EasyMotion#T(-1,0,1)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-Tn)', 'v') ==# '<Esc>:<C-U>call EasyMotion#T(50,1,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Tn)', 'v') ==# '<Esc>:<C-U>call EasyMotion#T(-1,1,1)<CR>'
|
||||||
" sln
|
" sln
|
||||||
Expect maparg('<Plug>(easymotion-sln)', 'n') ==# ':<C-U>call EasyMotion#SL(50,0,2)<CR>'
|
Expect maparg('<Plug>(easymotion-sln)', 'n') ==# ':<C-U>call EasyMotion#SL(-1,0,2)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-sln)', 'o') ==# ':<C-U>call EasyMotion#SL(50,0,2)<CR>'
|
Expect maparg('<Plug>(easymotion-sln)', 'o') ==# ':<C-U>call EasyMotion#SL(-1,0,2)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-sln)', 'v') ==# '<Esc>:<C-U>call EasyMotion#SL(50,1,2)<CR>'
|
Expect maparg('<Plug>(easymotion-sln)', 'v') ==# '<Esc>:<C-U>call EasyMotion#SL(-1,1,2)<CR>'
|
||||||
" fln
|
" fln
|
||||||
Expect maparg('<Plug>(easymotion-fln)', 'n') ==# ':<C-U>call EasyMotion#SL(50,0,0)<CR>'
|
Expect maparg('<Plug>(easymotion-fln)', 'n') ==# ':<C-U>call EasyMotion#SL(-1,0,0)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-fln)', 'o') ==# ':<C-U>call EasyMotion#SL(50,0,0)<CR>'
|
Expect maparg('<Plug>(easymotion-fln)', 'o') ==# ':<C-U>call EasyMotion#SL(-1,0,0)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-fln)', 'v') ==# '<Esc>:<C-U>call EasyMotion#SL(50,1,0)<CR>'
|
Expect maparg('<Plug>(easymotion-fln)', 'v') ==# '<Esc>:<C-U>call EasyMotion#SL(-1,1,0)<CR>'
|
||||||
" Fln
|
" Fln
|
||||||
Expect maparg('<Plug>(easymotion-Fln)', 'n') ==# ':<C-U>call EasyMotion#SL(50,0,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Fln)', 'n') ==# ':<C-U>call EasyMotion#SL(-1,0,1)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-Fln)', 'o') ==# ':<C-U>call EasyMotion#SL(50,0,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Fln)', 'o') ==# ':<C-U>call EasyMotion#SL(-1,0,1)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-Fln)', 'v') ==# '<Esc>:<C-U>call EasyMotion#SL(50,1,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Fln)', 'v') ==# '<Esc>:<C-U>call EasyMotion#SL(-1,1,1)<CR>'
|
||||||
" tln
|
" tln
|
||||||
Expect maparg('<Plug>(easymotion-tln)', 'n') ==# ':<C-U>call EasyMotion#TL(50,0,0)<CR>'
|
Expect maparg('<Plug>(easymotion-tln)', 'n') ==# ':<C-U>call EasyMotion#TL(-1,0,0)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-tln)', 'o') ==# ':<C-U>call EasyMotion#TL(50,0,0)<CR>'
|
Expect maparg('<Plug>(easymotion-tln)', 'o') ==# ':<C-U>call EasyMotion#TL(-1,0,0)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-tln)', 'v') ==# '<Esc>:<C-U>call EasyMotion#TL(50,1,0)<CR>'
|
Expect maparg('<Plug>(easymotion-tln)', 'v') ==# '<Esc>:<C-U>call EasyMotion#TL(-1,1,0)<CR>'
|
||||||
" Tln
|
" Tln
|
||||||
Expect maparg('<Plug>(easymotion-Tln)', 'n') ==# ':<C-U>call EasyMotion#TL(50,0,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Tln)', 'n') ==# ':<C-U>call EasyMotion#TL(-1,0,1)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-Tln)', 'o') ==# ':<C-U>call EasyMotion#TL(50,0,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Tln)', 'o') ==# ':<C-U>call EasyMotion#TL(-1,0,1)<CR>'
|
||||||
Expect maparg('<Plug>(easymotion-Tln)', 'v') ==# '<Esc>:<C-U>call EasyMotion#TL(50,1,1)<CR>'
|
Expect maparg('<Plug>(easymotion-Tln)', 'v') ==# '<Esc>:<C-U>call EasyMotion#TL(-1,1,1)<CR>'
|
||||||
"}}}
|
"}}}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user