Hi ,
In my code, if I found a string 'end', I want using searchpair() to find the match line(string 'begin').
I'm using searchpair('\<begin\>','','\<end\>','bn'), 'bn' means backward and no move cursor.
If I put cursor at end 2, I expect the return value is begin 2's line number.
I have tested it with echo. It seems no matter where I put the cursor(end 1, end 2 or end 3),
it will always return the first begin line number.
If I use forward search -- searchpair('\<begin\>','','\<end\>'), it will return the correct value.
I put cursor at begin 2, it will return the line number of end 2.
begin 1
begin 2
begin 3
end 3
end 2
end 1
Is this a bug for searchpair() ? Or I put the wrong parameters?
Sincerely,
Michael
--
You received this message from the "vim_use" 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
No comments:
Post a Comment