Friday, August 17, 2012

Re: What happens to jump list when jumping via exe?

On 8/17/12, rainy <andrei.avk@gmail.com> wrote:
> On Friday, August 17, 2012 12:44:02 PM UTC-4, rainy wrote:
>> Hi, I'm using 7.3 and when I make a jump via exe, e.g.:
>>
>> :exe '/def '.expand('<cword>')
>>
>> Previous location does not show up in jump list and instead some random
>> locations show up there. Obviously, ctrl-o does not work to jump to
>> previous spot.
>>
>> Is this a known issue and is there a workaround?
>>
>> Thanks!
>
>
> I found a way to fix this - by setting ' mark (m').

You can also use search() instead. It is much more versatile because
it has tons of options.
call search('def '.expand('<cword>'), 's')

Regards,
Vlad

--
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: