preservim / tagbar

Vim plugin that displays tags in a window, ordered by scope
https://preservim.github.io/tagbar
Other
6.13k stars 487 forks source link

Goes to minimap instead of code on enter #700

Closed ghost closed 4 years ago

ghost commented 4 years ago

I'm using minimap.vim, and when I press enter in tagbar, instead of going to the function in the code, it goes to an open minimap.vim window.

Gif:

output

raven42 commented 4 years ago

It looks like this is occurring because of window/buffer switching that is happens both in tagbar and minimap when the active buffer changes. In both plugins, they update their own windows when the active buffer changes. So they read in the file data for the active buffer, then switch to themselves, then redraw themselves, and switch back to the previous buffer. So what you are seeing here is a side effect of that buffer switching.

Fortunately it looks like this is an easy fix (at least it was when I tried it). You can update the minimap configuration to ignore the tagbar window. I added the following to my .vimrc and the tagbar jumps are all working as expected now.

let g:minimap_block_filetypes = ['fugitive', 'nerdtree', 'tagbar']

The 'fugitive' and 'nerdtree' entries are in the default list in the minimap plugin. So adding 'tagbar' to the list did the trick for me.

ghost commented 4 years ago

The minimap configuration worked for me. Thanks.

alerque commented 4 years ago

I've submitted that change as a PR to minimap.

alerque commented 4 years ago

@12-Seconds This fix was merged into minimap defaults so you should be able to drop your custom config again.

ghost commented 4 years ago

@alerque It works without the custom config, thanks!