search() problem

37 views
Skip to first unread message

Marcin Szamotulski

unread,
Mar 26, 2013, 9:45:40 PM3/26/13
to Vim Dev
Dear Devs,

I've found a problem with the search() function. Put a line like the
one below

( X

as a last line which contains a (. Then place the cursor over X and run:
:call search('(', 'cW')
Here the cursor lands on (. It seems that with the 'c' switch the
search begins where the line begins, since

( ( X
(again placing the cursor over X, and assuming that there are no more
brackets in the file) the search will end over the first bracket.

I have tested this with vim -u NONE on Linux (vim 7.3.871).

Best regards,
Marcin

Sung Pae

unread,
Mar 27, 2013, 12:31:29 AM3/27/13
to Vim Dev, Marcin Szamotulski
On Wed, Mar 27, 2013 at 01:45:40AM +0000, Marcin Szamotulski wrote:

> :call search('(', 'cW')
> Here the cursor lands on (. It seems that with the 'c' switch the
> search begins where the line begins, since
>
> ( ( X
> (again placing the cursor over X, and assuming that there are no more
> brackets in the file) the search will end over the first bracket.
>
> I have tested this with vim -u NONE on Linux (vim 7.3.871).

Hello,

This was a regression in 7.3.871. A user of one of my plugins alerted me
to the issue, and I mailed a proposed solution in this thread:

https://groups.google.com/d/msg/vim_dev/UNuAJ_lKqng/XRPH6LN9vmQJ

Cheers.

Sung Pae
Reply all
Reply to author
Forward
0 new messages