Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce search behavior according to &foldopen #152

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

milsen
Copy link

@milsen milsen commented Aug 3, 2015

Resolve #102. Sneaking with set foldopen-=search will now handle closed folds like single targets and skip over multiple search results inside of them. With set foldopen+=search, i.e. the default behavior, closed folds are opened when sneaking to them.
Streak-mode behavior is not influenced by this patch.

\ ,'streak' : get(g:, 'sneak#streak', 0) && (v:version >= 703) && has("conceal")
\ ,'streak_esc' : get(g:, 'sneak#streak_esc', "\<space>")
\ ,'prompt' : get(g:, 'sneak#prompt', '>')
\ }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 spaces wasn't enough?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That just happened accidentally. I have a leader command to indent the whole file, and apparently some of my indentation settings are a little different from yours.

@justinmk
Copy link
Owner

justinmk commented Aug 3, 2015

Thanks, I will test this later. Functional tests would help too, though it's fine if you don't want to.

milsen added a commit to milsen/vim-sneak that referenced this pull request Aug 4, 2015
milsen added a commit to milsen/vim-sneak that referenced this pull request Aug 4, 2015
For "set foldlevel-=search" sneaking did not properly skip to the end of
closed folds. Now it does. See pull request justinmk#152.
milsen added a commit to milsen/vim-sneak that referenced this pull request Aug 4, 2015
Give the do-blocks a better description and remove unnecessary option
settings in the execute-blocks. See justinmk#152.
Sneaking now behaves like / when "foldopen-=search" is set: Closed folds
are considered to be single targets and are not opened when sneaking to
them. They are opened, however, when the default-&foldopen is used or
"foldopen+=search" is set.
Resolve justinmk#102.

This does not affect streak-mode (which still ignores &foldopen).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sneak doesn't skip hidden fold targets with set foldopen-=search
2 participants