Christian Brabandt wrote:
> On Mi, 09 Jan 2013, Ben Fritz wrote:
>
> > This seems to be related to the cursor being within the fold.
>
> Yes, the source code says this:
>
> /* If the cursor is in a closed fold, don't find another match in the same
> * fold. */
> if (dirc == '/')
> {
> if (hasFolding(pos.lnum, NULL, &pos.lnum))
> pos.col = MAXCOL - 2; /* avoid overflow when adding 1 */
> }
>
> This means, the search starts actually after the fold. Because wrapscan
> applies, Vim will start searching from the beginning of the file again
> and find the match and open the fold. If wrapscan is not set, this will
> abort since the pattern is not found.
I would argue that the current behavior is correct. Suppose there are
no folds and there is one occurrence of "foo". Then /foo moves to that
"foo" when 'wrapscan' is set, also when the search is repeated. When
'wrapscan' is off then the second search fails.
In a closed fold it's like the cursor is already at the "foo" inside it.
When 'wrapscan' is set /foo finds it again. When 'wrapscan' is off it
doesn't find another foo and fails.
--
If VIM were a woman, I'd marry her. Slim, organized, helpful
and beautiful; what's not to like? --David A. Rogers
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php