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

while split tagbar jumptotag fail #772

Open
wellcomez opened this issue Jun 18, 2021 · 1 comment
Open

while split tagbar jumptotag fail #772

wellcomez opened this issue Jun 18, 2021 · 1 comment
Labels

Comments

@wellcomez
Copy link

wellcomez commented Jun 18, 2021

  1. open tagbar
  2. split tagbar window
  3. open tag inside of tagbar
  4. Error message w:autoclose undefined. jump fail

root cause
at
function! s:JumpToTag(stay_in_tagbar) abort
let taginfo = s:GetTagInfo(line('.'), 1)
let autoclose= w:autoclose

solution
check whether w:autoclose existed

let autoclose= exists('w:autoclose') && w:autoclose ? 1 : 0

raven42 added a commit to raven42/tagbar that referenced this issue Jun 18, 2021
Potential fix for preservim#772

This issue is being caused by the InitWindow() routine not being called
when a split of the tagbar window occurs. This will potentially fix that
issue by forceably calling s:InitWindow() when a new tagbar window is
found.

Note however, that when closing one of the split tagbar windows, it does
cause the other one to close as well. It looks like there is an issue on
the close processing that it identifies all windows that have the tagbar
buffer loaded as the tagbar window.
@raven42
Copy link
Collaborator

raven42 commented Jun 18, 2021

I have pushed up a potential fix. There are a lot more than just the w:autoclose that are not set. To properly fix this I think we'd need to call the s:InitWindow() when a split occurs. The PR can be used as a baseline, but I haven't fully tested everything or fully examined the implications. On basic testing it does appear to fix the issue though and the split works successfully after this patch.

@raven42 raven42 added the bug label Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants