Thursday, October 3, 2013

Re: Each buffer in own tab/function lookup seem to clash

Thanks Ben,

I actually did try

         exe 'tjump ' . expand('<cword>')
         exe 'tjump ' . expand('<cword>')

initially, but all hell breaks lose with that :)

Looks like

   try
         exe 'tjump ' . expand('<cword>')
         0tag

Does the trick - at least in the sense that it *always* finds the relevant tag.  There's some weirdness with tab behaviour if you drill down, back out, then drill down again.  The second drill down results in new tabs never being opened again in the current session...  but screw it.  At least now it reliably finds the tag.

Thanks for your input!

Cheers
Henry
  


On Wed, Oct 2, 2013 at 3:36 PM, Ben Fritz <fritzophrenic@gmail.com> wrote:
On Wednesday, October 2, 2013 7:37:35 AM UTC-5, Henry wrote:
> > > If that doesn't work, you could try modifying your MatchCaseTag function
>
> > > to issue a second tjump command in case the first doesn't work. It's a
>
> > > hack, but maybe it will fix your problem.
>
> By "in case the first doesn't work" I presume you mean an exception?
>
>     try
>         exe 'tjump ' . expand('<cword>')
>
>     catch
>         exe 'tjump ' . expand('<cword>')
>     finally
>        let &ic = ic
>     endtry
>
>
> But this doesn't do much because the first exe/tjump doesn't actually "fail" per se:  it always opens the file successfully...
>
>
> Unless I'm not understanding your suggestion correctly?
>

Nope, I just meant something stupid and hacky like:

     try
         exe 'tjump ' . expand('<cword>')
         exe 'tjump ' . expand('<cword>')
     finally
        let &ic = ic
     endtry

Now I realize you could probably do better using the tag stack, taking a hint from the examples given just under ":help :tags":

     try
         exe 'tjump ' . expand('<cword>')
         0tag
     finally
        let &ic = ic
     endtry

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

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/juMNxDig_O4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
--
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
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: