Skip to content

Commit

Permalink
do not add to jumplist on consecutive invocations.
Browse files Browse the repository at this point in the history
ref #88 / thanks @lydell
  • Loading branch information
justinmk committed Jul 1, 2014
1 parent 9eb89e4 commit daf9c90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions autoload/sneak/search.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ func! sneak#search#new()
" do not wrap search backwards
let self._search_options = 'W' . (a:reverse ? 'b' : '')
let self.search_options_no_s = self._search_options
" save the jump on the initial invocation, _not_ repeats.
if !a:repeatmotion | let self._search_options .= 's' | endif
" save the jump on the initial invocation, _not_ repeats or consecutive invocations.
if !a:repeatmotion && !sneak#is_sneaking() | let self._search_options .= 's' | endif
endf

func! s.initpattern()
Expand Down
7 changes: 5 additions & 2 deletions doc/sneak.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ or whatever (if any) key you mapped to <Plug>SneakNext.

Sneak adds to the |jumplist| only on the initial invocation; so after moving
around with ; and , (or s/S) you can easily go back via |CTRL-O| or |``|.
- Repeat invocations (;/,) do not add to the jumplist.
- Consecutive invocations ("s" immediately after s/S/;/,)
do not add to the jumplist.

s<Enter> ("s" followed by Enter) always repeats the last search, even if |;|
and |,| were reset by |f| or |t|. This is especially useful for re-invoking
Expand Down Expand Up @@ -249,8 +252,8 @@ Streak-mode features:
- automatically jumps to the first match
- press <Space> or <Esc> to escape streak-mode
- press <Tab> to skip to the next 56 matches
- press any key that is _not_ displayed as a target label to exit
streak-mode and immediately perform that key's normal-mode function
- press any key that is _not_ a target label to exit streak-mode and
immediately perform that key's normal-mode function
- works with all operators, including |surround|
- streak-mode edit operations can be repeated and it works correctly
regardless of the remaining on-screen matches
Expand Down

0 comments on commit daf9c90

Please sign in to comment.