Add g:ale_sign_highlight_linenr (#2678)

* add g:ale_sign_highlight_linenr
* Fix tests. Change option default value
* Rename ale_sign_highlight_linenr to ale_sign_highlight_linenrs
* Default ale_sign_highlight_linenrs to 0
This commit is contained in:
BlahGeek 2019-09-01 21:03:54 +08:00 committed by w0rp
parent 67ee2b9586
commit 9f814a8ce9
4 changed files with 18 additions and 3 deletions

View File

@ -50,6 +50,7 @@ let s:global_variable_list = [
\ 'ale_sign_style_error',
\ 'ale_sign_style_warning',
\ 'ale_sign_warning',
\ 'ale_sign_highlight_linenrs',
\ 'ale_statusline_format',
\ 'ale_type_map',
\ 'ale_use_global_executables',

View File

@ -20,6 +20,7 @@ let g:ale_sign_info = get(g:, 'ale_sign_info', g:ale_sign_warning)
let g:ale_sign_offset = get(g:, 'ale_sign_offset', 1000000)
" This flag can be set to 1 to keep sign gutter always open
let g:ale_sign_column_always = get(g:, 'ale_sign_column_always', 0)
let g:ale_sign_highlight_linenrs = get(g:, 'ale_sign_highlight_linenrs', 0)
if !hlexists('ALEErrorSign')
highlight link ALEErrorSign error
@ -82,7 +83,7 @@ execute 'sign define ALEInfoSign text=' . s:EscapeSignText(g:ale_sign_info)
\ . ' texthl=ALEInfoSign linehl=ALEInfoLine'
sign define ALEDummySign
if has('nvim-0.3.2')
if g:ale_sign_highlight_linenrs && has('nvim-0.3.2')
if !hlexists('ALEErrorSignLineNr')
highlight link ALEErrorSignLineNr CursorLineNr
endif

View File

@ -1437,8 +1437,9 @@ g:ale_set_signs *g:ale_set_signs*
|ALEWarningLine| - All items with `'type': 'W'`
|ALEInfoLine| - All items with `'type': 'I'`
With Neovim 0.3.2 or higher, ALE uses `numhl` option to highlight 'number'
column. It uses the following highlight groups.
With Neovim 0.3.2 or higher, ALE can use `numhl` option to highlight 'number'
column. It uses the following highlight groups. To enable this feature,
see |g:ale_sign_highlight_linenrs|.
|ALEErrorSignLineNr| - Items with `'type': 'E'`
|ALEWarningSignLineNr| - Items with `'type': 'W'`
@ -1552,6 +1553,15 @@ g:ale_sign_warning *g:ale_sign_warning*
The sign for warnings in the sign gutter.
g:ale_sign_highlight_linenrs *g:ale_sign_highlight_linenrs*
Type: |Number|
Default: `0`
This option controls whether ALE should use `numhl` option to highlight 'number'
column in supported vim version.
g:ale_update_tagstack *g:ale_update_tagstack*
*b:ale_update_tagstack*
Type: |Number|

View File

@ -47,6 +47,7 @@ Before:
Save g:ale_sign_style_error
Save g:ale_sign_style_warning
Save g:ale_sign_warning
Save g:ale_sign_highlight_linenrs
Save g:ale_statusline_format
Save g:ale_type_map
Save g:ale_use_global_executables
@ -102,6 +103,7 @@ Before:
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'OK']
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
@ -178,6 +180,7 @@ Before:
\ 'let g:ale_sign_style_error = ''>>''',
\ 'let g:ale_sign_style_warning = ''--''',
\ 'let g:ale_sign_warning = ''--''',
\ 'let g:ale_sign_highlight_linenrs = 0',
\ 'let g:ale_statusline_format = [''%d error(s)'', ''%d warning(s)'', ''OK'']',
\ 'let g:ale_type_map = {}',
\ 'let g:ale_use_global_executables = v:null',