Closed daedroza closed 2 years ago
This is occurring with very large tags that exceed the available space on the tagbar window. It is part of the vim wrap
with linebreak
functionality and is unavoidable when both these options are set.
As per original implementation of the g:tagbar_wrap
feature in #659 there was no explicit call to do a setlocal linebreak
. However if this is set by the user via a set linebreak
, then the tagbar window will inherit this setting.
This could be a point of contention how the user prefers to see the wrap occur. In some cases using the linebreak
option to only allow breaking at words makes it much easier to read. Contrary to this, if the user has a lot of very long tags that cause a wrap, then it will look weird. Unfortunately there is not a way to break on words after the first one, so the tag word is being pushed to the wrapped line causing this display issue.
To fix this, it will probably be best to allow the user to control it via the g:tagbar_wrap
configuration with an additional value to explicitly control the linebreak
functionality.
Pushed up #785 as a potential fix for this. @daedroza can you try it out and let me know if this looks like it will work for your needs?
Tested with tagbar_wrap = 2. It works as intended!
When tagbar_wrap is set to 1 with linebreak, tagbar_wrap messes up indentation. A screenshot can be found here.
The only way to mitigate this issue is to set nolinebreak, however setting this from global init.vimrc is not a complete solution as people might want linebreak as well.