Loading ...
Sorry, an error occurred while loading the content.

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

Expand Messages
  • Henry Combrinck
    Thanks Ben, I actually did try exe tjump . expand( ) exe tjump . expand( ) initially, but all hell breaks lose with that :) Looks like
    Message 1 of 11 , Oct 3, 2013
    • 0 Attachment
      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@...> 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@....
      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@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Ben Fritz
      ... Heh, I m actually realizing the first approach should not re-read the after the first tjump command, it should store off the expand( )
      Message 2 of 11 , Oct 3, 2013
      • 0 Attachment
        On Thursday, October 3, 2013 4:29:11 AM UTC-5, Henry wrote:
        > 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. 

        Heh, I'm actually realizing the first approach should not re-read the <cword> after the first tjump command, it should store off the expand('<cword>') result and use it twice instead of grabbing the word under the new cursor position.

        But the second approach is nicer anyway, so I wouldn't bother trying to get the first to wok.

        --
        --
        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@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.