Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add g:ale_sign_highlight_linenr #2678

Merged
merged 4 commits into from
Sep 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions autoload/ale/debugging.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion autoload/ale/sign.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions doc/ale.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1426,8 +1426,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'`
Expand Down Expand Up @@ -1541,6 +1542,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|
Expand Down
3 changes: 3 additions & 0 deletions test/test_ale_info.vader
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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_warn_about_trailing_whitespace
Expand All @@ -43,6 +44,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_warn_about_trailing_whitespace = 1
Expand Down Expand Up @@ -116,6 +118,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',
Expand Down