Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagbar window doesn't update after switching buffers #162

Closed
mMontu opened this issue Jul 30, 2013 · 9 comments
Closed

Tagbar window doesn't update after switching buffers #162

mMontu opened this issue Jul 30, 2013 · 9 comments

Comments

@mMontu
Copy link

mMontu commented Jul 30, 2013

Sometimes Tagbar window doesn't update after switching buffers. After entering this state, it behaves like each buffer is tied to a different instance of Tagbar, so executing :TagbarToggle in different buffers leads to multiple Tagbar windows on the same tab.

As mentioned on issue #153, it is not clear all the details needed to reproduce this problem. This is the procedure to reproduce it:

  • Two files in a single tab using vertical split
  • With cursor on file A, :TagbarToggle -> (opens Tagbar window)
  • Move cursor to file B, :TagbarToggle -> (closes Tagbar window)
  • :TagbarToggle -> (opens Tagbar window)
  • Move cursor to file A, notice that Tagbar window do not update
  • :TagbarToggle -> two Tagbar windows

It only works for some files, though. I didn't detect what is specific to the files that trigger the problem, other than being part of a large project (what causes longer executions of ctags).

@majutsushi
Copy link
Collaborator

I'm still not able to reproduce this. This is rather frustrating. Are the files that trigger the bug themselves large? The size of the project shouldn't matter, as Tagbar only generates tags for the current file. Do you have any publicly available example files that I could try? Also, do you have more than one tab open?

@mMontu
Copy link
Author

mMontu commented Aug 19, 2013

Usually I have more than one tab page open, but I'm able to reproduce the bug on a new Vim instance without opening any tabs. The files are usually larges, but I believed that the problem was the project size, so I haven't focused too much on the files. I've just found an easy way to reproduce the problem:

  • create file test/class1.cs with the following 3 lines:
class Class1
{
}
  • create file test2/class2.cs with the following 3 lines:
class Class2
{
}
  • follow the steps on my previous comment.

The same two files placed in the same folder doesn't triggers the bug.

Please let me know if you are still unable to reproduce the issue, then I can check if it is caused by some setting/plugin on my setup.

@majutsushi
Copy link
Collaborator

Still no go ... what version of Vim are you using? Maybe it is a Vim bug that got fixed recently.

@mMontu
Copy link
Author

mMontu commented Aug 24, 2013

I'm using the version 7.3, downloaded from vim.org:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2010 17:59:02)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-46
Compiled by Bram@KIBAALE
Big version with GUI.

@majutsushi
Copy link
Collaborator

Oh, that's a pretty old version. If possible I would suggest downloading the new 7.4 release, not just because of this issue but also in general. If upgrading doesn't fix it I'll give it a try with Windows in a virtual machine.

@mMontu
Copy link
Author

mMontu commented Aug 26, 2013

I'll update to new version soon, maybe it include the fix. But I found a setting in my .vimrc that is probably causing the problem. It is an autocmd used to change the working directory of current directory, from tip #64, with adaptation to work with fugitive.vim:

augroup pathBufEnter
   au!
   autocmd BufEnter * if expand('%:p') !~ ':\\\\' | lcd %:p:h:gs?\\?/? | endif
augroup END

When I remove it the issue disappears.

Maybe tagbar is relying the path being unchanged, but I didn't investigate this further.

@majutsushi
Copy link
Collaborator

Even with that autocommand it's working fine for me, even with a minimal configuration. Have you tried a current Vim version to see if that fixes it for you?

@mMontu
Copy link
Author

mMontu commented Nov 14, 2013

The new version of Vim indeed solves the problem.

Thank you very much!

@mMontu mMontu closed this as completed Nov 14, 2013
@majutsushi
Copy link
Collaborator

Great, thanks for checking! Good to know that I wasn't just doing something wrong ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants