Skip to content

Commit

Permalink
Let folds open if &foldopen contains 'search'
Browse files Browse the repository at this point in the history
Since vim-sneak does not work with the /-command but with the searchpos-function, the opening of folds must be done explicitly.
The skipping of the content of closed folds if &foldopen does not contain 'search' should also be implemented in the future. See justinmk#102.
  • Loading branch information
milsen committed Aug 3, 2015
1 parent c6b5708 commit a7f59bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugin/sneak.vim
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ func! sneak#to(op, input, inputlen, count, repeatmotion, reverse, inclusive, str
endif
"search succeeded

" if &foldopen contains search, folds are opened when jumping to matches
if !empty(matchstr(&foldopen,"search"))
norm! zv
endif

call sneak#hl#removehl()

if (!is_op || a:op ==# 'y') "position _after_ search
Expand Down

0 comments on commit a7f59bf

Please sign in to comment.