1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 11:30:28 +01:00

Merge pull request #659 from raven42/line-wrap

Fix for #647: Add g:tagbar_wrap option
This commit is contained in:
raven42
2020-09-21 10:09:18 -05:00
committed by GitHub
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