mirror of
https://github.com/preservim/tagbar.git
synced 2025-02-12 21:47:31 +08:00
Add option to show line numbers, closes #146
This commit is contained in:
parent
fec9b2a1ab
commit
24efd12f50
|
@ -1756,14 +1756,25 @@ function! s:InitWindow(autoclose) abort
|
|||
setlocal nobuflisted
|
||||
setlocal nomodifiable
|
||||
setlocal nolist
|
||||
setlocal nonumber
|
||||
setlocal nowrap
|
||||
setlocal winfixwidth
|
||||
setlocal textwidth=0
|
||||
setlocal nospell
|
||||
|
||||
if exists('+relativenumber')
|
||||
setlocal norelativenumber
|
||||
if g:tagbar_show_linenumbers == 0
|
||||
setlocal nonumber
|
||||
if exists('+relativenumber')
|
||||
setlocal norelativenumber
|
||||
endif
|
||||
elseif g:tagbar_show_linenumbers == 1
|
||||
setlocal number
|
||||
elseif g:tagbar_show_linenumbers == 2
|
||||
setlocal relativenumber
|
||||
else
|
||||
set number<
|
||||
if exists('+relativenumber')
|
||||
set relativenumber<
|
||||
endif
|
||||
endif
|
||||
|
||||
setlocal nofoldenable
|
||||
|
|
|
@ -470,6 +470,23 @@ Example:
|
|||
let g:tagbar_show_visibility = 0
|
||||
<
|
||||
|
||||
*g:tagbar_show_linenumbers*
|
||||
g:tagbar_show_linenumbers~
|
||||
Default: 0
|
||||
|
||||
Whether line numbers should be shown in the Tagbar window.
|
||||
|
||||
Possible values are:
|
||||
0: Don't show any line numbers.
|
||||
1: Show absolute line numbers.
|
||||
2: Show relative line numbers.
|
||||
-1: Use the global line number settings.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_show_linenumbers = 2
|
||||
<
|
||||
|
||||
*g:tagbar_expand*
|
||||
g:tagbar_expand~
|
||||
Default: 0
|
||||
|
|
|
@ -58,6 +58,7 @@ let s:options = [
|
|||
\ ['indent', 2],
|
||||
\ ['left', 0],
|
||||
\ ['show_visibility', 1],
|
||||
\ ['show_linenumbers', 0],
|
||||
\ ['singleclick', 0],
|
||||
\ ['sort', 1],
|
||||
\ ['systemenc', &encoding],
|
||||
|
|
Loading…
Reference in New Issue
Block a user