phpcomplete.vim icon indicating copy to clipboard operation
phpcomplete.vim copied to clipboard

C-] opens the definition on an existing buffer and not the current buffer

Open dsdeiz opened this issue 11 years ago • 5 comments

For some weird reason C-] opens a definition on an existing buffer and not the current buffer. Is this an expected behavior?

dsdeiz avatar Jun 25 '15 08:06 dsdeiz

Do you mean (this is my best guess) that if you have the file with the definition already in a buffer then it somehow makes a difference when hitting the c-] combination compared to when you don't?

I'm not sure what do you mean by existing vs current buffer. Could you please ellaborate on this?

complex857 avatar Jun 25 '15 08:06 complex857

Oops, sorry. This is how I can reproduce it:

  1. Open a file which is now on window A.
  2. C-W C-] on a function call (at this time it opens the file on window B and goes to the definition - somewhat messed up my terms, should've been window instead of buffer)
  3. On window B, C-] on another function call. This time it opens the function definition on window A.

I was assuming on the 3rd step, it would simply open the file with the function definition on window B but instead it opened it on window A.

dsdeiz avatar Jun 25 '15 09:06 dsdeiz

Oh, i see. This jump-to-definition feature works by vim's own :tag command (prefixed with the number) so i guess that this is how it's supposed to work, but would worth checking if the behaviour changes when the plugins is disabled.

complex857 avatar Jun 25 '15 12:06 complex857

Yeah it's different without the plugin. On the 3rd step, it would open on window B when pressing C-] on a function call in window B. Not sure if it's relevant but :map <C-]> produces a call to phpcomplete#JumpToDefinition('normal').

dsdeiz avatar Jun 25 '15 23:06 dsdeiz

Thanks for looking into this for me! At this moment i have no clue of the reasons behind this, but I'll try to get the bottom of this.

complex857 avatar Jun 26 '15 05:06 complex857