diff options
author | w0rp <devw0rp@gmail.com> | 2016-10-05 10:59:01 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2016-10-05 10:59:01 +0100 |
commit | 0305e8ad623c44ab2feaac12aa87b095b7ad87a7 (patch) | |
tree | 6b7b80b45c8e52dc5ba8fd964ceb67d04959625d | |
parent | 10ae2889254f888f3e22447a9a1f1c2ab83fbd54 (diff) | |
download | ale-0305e8ad623c44ab2feaac12aa87b095b7ad87a7.zip |
Simplify the IDs used for the dummy sign, so it automatically uses the configurable offset value.
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | plugin/ale/sign.vim | 8 |
2 files changed, 4 insertions, 5 deletions
@@ -81,7 +81,6 @@ vimrc file for all given linters is as follows: | `g:ale_sign_error` | the text to use for errors in the gutter | `'>>'` | | `g:ale_sign_warning` | the text to use for warnings in the gutter | `'--'` | | `g:ale_sign_offset` | an offset for sign ids | `1000000` | -| `g:ale_sign_dummy_id` | the id for keeping the gutter open | `10000000` | | `g:ale_echo_cursor` | echo errors when the cursor is over them | `1` | | `g:ale_warn_about_trailing_whitespace` | enable trailing whitespace warnings for some linters | `1` | diff --git a/plugin/ale/sign.vim b/plugin/ale/sign.vim index 08235f6b..0a337bd4 100644 --- a/plugin/ale/sign.vim +++ b/plugin/ale/sign.vim @@ -28,8 +28,8 @@ let g:ale_sign_error = get(g:, 'ale_sign_error', '>>') let g:ale_sign_warning = get(g:, 'ale_sign_warning', '--') " An offset which can be set for sign IDs. " This ID can be changed depending on what IDs are set for other plugins. +" The dummy sign will use the ID exactly equal to the offset. let g:ale_sign_offset = get(g:, 'ale_sign_offset', 1000000) -let g:ale_sign_dummy_id = get(g:, 'ale_sign_dummy_id', 10000000) " Signs show up on the left for error markers. execute 'sign define ALEErrorSign text=' . g:ale_sign_error @@ -95,7 +95,7 @@ function! ale#sign#SetSigns(buffer, loclist) if len(signlist) > 0 || g:ale_sign_column_always " Insert a dummy sign if one is missing. - execute 'sign place ' . g:ale_sign_dummy_id + execute 'sign place ' . g:ale_sign_offset \ . ' line=1 name=ALEDummySign buffer=' \ . a:buffer endif @@ -113,7 +113,7 @@ function! ale#sign#SetSigns(buffer, loclist) let obj = signlist[i] let name = obj['type'] ==# 'W' ? 'ALEWarningSign' : 'ALEErrorSign' - let sign_line = 'sign place ' . (i + g:ale_sign_offset) + let sign_line = 'sign place ' . (i + g:ale_sign_offset + 1) \. ' line=' . obj['lnum'] \. ' name=' . name \. ' buffer=' . a:buffer @@ -122,6 +122,6 @@ function! ale#sign#SetSigns(buffer, loclist) endfor if !g:ale_sign_column_always && len(signlist) > 0 - execute 'sign unplace ' . g:ale_sign_dummy_id . ' buffer=' . a:buffer + execute 'sign unplace ' . g:ale_sign_offset . ' buffer=' . a:buffer endif endfunction |