Re: using /foo/;/foo/e
- Richard P. Groenewegen wrote:
> This puzzles me. Consider the following `sentence':It's not a bug. Try this:
> one two three four five
> and let's say the cursor is on `one'.
> /two/;/four/e<CR> leaves the cursor on the 'r' of 'four',
> as expected.
> Now consider the following sentence
> one foo three foo five
> In this case
> /foo/;/foo<CR> leaves the cursor on the 'f' of the second
> `foo', as expected.
> /foo/;/foo/e<CR> leaves the cursor on the second 'o' of the
> first `foo'. This was unexpected.
> Can someone explain, or is this a bug?
Start with the cursor at the start of "foo". You will notice it moves to the
end of the same word. Thus using "/foo/;/foo/e" first moves to the start of
"foo" and then to the end of the same "foo".
The reason is that a search will always move the cursor forward, but it may
find a match under the current cursor position.
Not too long ago, compress was something you did to garbage...
/// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
\\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///