preservim / tagbar

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

while split tagbar jumptotag fail #772

Open wellcomez opened 3 years ago

wellcomez commented 3 years ago
  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 commented 3 years ago

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.