Cosmetic
This commit is contained in:
parent
0cd3711be8
commit
d78ad4db69
@ -786,10 +786,13 @@ endfunction "}}}
|
|||||||
call s:VarReset('&foldmethod', 'manual')
|
call s:VarReset('&foldmethod', 'manual')
|
||||||
" }}}
|
" }}}
|
||||||
" Find motion targets {{{
|
" Find motion targets {{{
|
||||||
|
" Setup searchpos args {{{
|
||||||
let search_direction = (a:direction >= 1 ? 'b' : '')
|
let search_direction = (a:direction >= 1 ? 'b' : '')
|
||||||
let search_stopline = line(a:direction >= 1 ? 'w0' : 'w$')
|
let search_stopline = line(a:direction >= 1 ? 'w0' : 'w$')
|
||||||
|
|
||||||
let search_at_cursor = fixed_column ? 'c' : ''
|
let search_at_cursor = fixed_column ? 'c' : ''
|
||||||
|
"}}}
|
||||||
|
|
||||||
|
" Construct match dict {{{
|
||||||
while 1
|
while 1
|
||||||
let pos = searchpos(a:regexp, search_direction . search_at_cursor, search_stopline)
|
let pos = searchpos(a:regexp, search_direction . search_at_cursor, search_stopline)
|
||||||
let search_at_cursor = ''
|
let search_at_cursor = ''
|
||||||
@ -806,7 +809,9 @@ endfunction "}}}
|
|||||||
|
|
||||||
call add(targets, pos)
|
call add(targets, pos)
|
||||||
endwhile
|
endwhile
|
||||||
|
"}}}
|
||||||
|
|
||||||
|
" Handle direction == 2"{{{
|
||||||
if a:direction == 2
|
if a:direction == 2
|
||||||
keepjumps call cursor(orig_pos[0], orig_pos[1])
|
keepjumps call cursor(orig_pos[0], orig_pos[1])
|
||||||
let targets2 = []
|
let targets2 = []
|
||||||
@ -816,9 +821,11 @@ endfunction "}}}
|
|||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Handle folded line"{{{
|
||||||
if foldclosed(pos[0]) != -1 && (g:EasyMotion_skipfoldedline == 1 || pos[0] != foldclosed(pos[0]))
|
if foldclosed(pos[0]) != -1 && (g:EasyMotion_skipfoldedline == 1 || pos[0] != foldclosed(pos[0]))
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
"}}}
|
||||||
|
|
||||||
call add(targets2, pos)
|
call add(targets2, pos)
|
||||||
endwhile
|
endwhile
|
||||||
@ -836,13 +843,15 @@ endfunction "}}}
|
|||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
let targets = targets3
|
let targets = targets3
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
"}}}
|
||||||
|
|
||||||
|
" Handle no match"{{{
|
||||||
let targets_len = len(targets)
|
let targets_len = len(targets)
|
||||||
if targets_len == 0
|
if targets_len == 0
|
||||||
throw 'No matches'
|
throw 'No matches'
|
||||||
endif
|
endif
|
||||||
|
"}}}
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
let GroupingFn = function('s:GroupingAlgorithm' . s:grouping_algorithms[g:EasyMotion_grouping])
|
let GroupingFn = function('s:GroupingAlgorithm' . s:grouping_algorithms[g:EasyMotion_grouping])
|
||||||
@ -874,9 +883,10 @@ endfunction "}}}
|
|||||||
endif
|
endif
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Prompt user for target group/character
|
" Prompt user for target group/character"{{{
|
||||||
let coords = s:PromptUser(groups, allows_repeat, fixed_column)
|
let coords = s:PromptUser(groups, allows_repeat, fixed_column)
|
||||||
let g:old_target = coords
|
let g:old_target = coords
|
||||||
|
"}}}
|
||||||
|
|
||||||
" Update selection {{{
|
" Update selection {{{
|
||||||
if ! empty(a:visualmode)
|
if ! empty(a:visualmode)
|
||||||
@ -896,7 +906,7 @@ endfunction "}}}
|
|||||||
endif
|
endif
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Update cursor position
|
" Update cursor position"{{{
|
||||||
call cursor(orig_pos[0], orig_pos[1])
|
call cursor(orig_pos[0], orig_pos[1])
|
||||||
let mark_save = getpos("'e")
|
let mark_save = getpos("'e")
|
||||||
call setpos("'e", [bufnr('%'), coords[0], coords[1], 0])
|
call setpos("'e", [bufnr('%'), coords[0], coords[1], 0])
|
||||||
@ -905,6 +915,7 @@ endfunction "}}}
|
|||||||
|
|
||||||
call s:Message('Jumping to [' . coords[0] . ', ' . coords[1] . ']')
|
call s:Message('Jumping to [' . coords[0] . ', ' . coords[1] . ']')
|
||||||
let g:EasyMotion_cancelled = 0
|
let g:EasyMotion_cancelled = 0
|
||||||
|
"}}}
|
||||||
catch
|
catch
|
||||||
redraw
|
redraw
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user