Saturday, August 18, 2012

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

>
> > 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')


Great, thanks. It is much better then exe. I saw this option in search()
doc but it doesn't say why it's useful so it's easy to miss.

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