Fix for #647: Add g:tagbar_wrap option

This commit is contained in:
raven42 2020-09-21 08:24:01 -05:00
parent 30fb229937
commit 22df1b87af
3 changed files with 27 additions and 1 deletions

View File

@ -954,10 +954,19 @@ function! s:InitWindow(autoclose) abort
" Window-local options
setlocal nolist
setlocal nowrap
setlocal winfixwidth
setlocal nospell
if g:tagbar_wrap == 0
setlocal nowrap
else
setlocal wrap
if exists('+linebreak')
setlocal breakindent
setlocal breakindentopt=shift:4
endif
endif
if g:tagbar_show_linenumbers == 0
setlocal nonumber
if exists('+relativenumber')

View File

@ -882,6 +882,22 @@ Example:
>
let g:tagbar_use_cache = 0
<
*g:tagbar_wrap*
g:tagbar_wrap~
Default: 0
If set to non-zero, this will enable line wrapping on the tagbar window. This
option will use the built-in |wrap| vim option on the tagbar window to
enable line wrapping. This also will use the |breakindent| and
|breakindentopt| options in vim to set the indentation of the wrapped lines.
Note: This requires VIM to be compiled with the |+linebreak| option for the
wrap intentation to function.
Example:
>
let g:tagbar_wrap = 1
>
------------------------------------------------------------------------------
HIGHLIGHT COLOURS *tagbar-highlight*

View File

@ -109,6 +109,7 @@ function! s:setup_options() abort
\ ['zoomwidth', 1],
\ ['silent', 0],
\ ['use_cache', 1],
\ ['wrap', 0],
\ ]
for [opt, val] in options