diff --git a/plugin/EasyMotion.vim b/plugin/EasyMotion.vim index df4c5d0..4704a20 100644 --- a/plugin/EasyMotion.vim +++ b/plugin/EasyMotion.vim @@ -260,6 +260,10 @@ let targets = [] let visualmode = a:0 > 0 ? a:1 : '' + " Store original scrolloff value + let scrolloff = &scrolloff + setl scrolloff=0 + " Find motion targets while 1 let search_direction = (a:direction == 1 ? 'b' : '') @@ -291,6 +295,9 @@ " Restore cursor position call setpos('.', [0, orig_pos[0], orig_pos[1]]) + " Restore original scrolloff value + execute 'setl scrolloff=' . scrolloff + return endif @@ -349,6 +356,9 @@ call setpos('.', [0, orig_pos[0], orig_pos[1]]) endif + " Restore original scrolloff value + execute 'setl scrolloff=' . scrolloff + return else if ! empty(visualmode) @@ -371,6 +381,9 @@ call setpos('.', [0, coords[0], coords[1]]) endif + " Restore original scrolloff value + execute 'setl scrolloff=' . scrolloff + call Message('Jumping to [' . coords[0] . ', ' . coords[1] . ']') endif endfunction " }}}