From 0305e8ad623c44ab2feaac12aa87b095b7ad87a7 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 5 Oct 2016 10:59:01 +0100 Subject: [PATCH] Simplify the IDs used for the dummy sign, so it automatically uses the configurable offset value. --- README.md | 1 - plugin/ale/sign.vim | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 627991a8..574e08ba 100644 --- a/README.md +++ b/README.md @@ -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