diff options
author | w0rp <devw0rp@gmail.com> | 2017-08-07 22:08:35 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-08-07 22:08:35 +0100 |
commit | 2edea153585560e5788d1761595eb0141ad6e3bd (patch) | |
tree | 8a0ad100d68a2dba2e2b90b3565bdb771d28411f /autoload | |
parent | c18451fba9b96efeb6da2cf72bc1214bfd821c3a (diff) | |
download | ale-2edea153585560e5788d1761595eb0141ad6e3bd.zip |
Fix the resetting of selections and annotate it
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/list.vim | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/autoload/ale/list.vim b/autoload/ale/list.vim index 3de6adbf..6186d863 100644 --- a/autoload/ale/list.vim +++ b/autoload/ale/list.vim @@ -38,14 +38,9 @@ function! ale#list#SetLists(buffer, loclist) abort " If we have errors in our list, open the list. Only if it isn't already open if (g:ale_open_list && !empty(a:loclist)) || g:ale_keep_list_window_open let l:winnr = winnr() - - let l:reset_visual_selection = 0 - let l:reset_character_selection = 0 - if mode() ==? 'v' || mode() ==# "\<c-v>" - let l:reset_visual_selection = 1 - elseif mode() ==? 's' || mode() ==# "\<c-s>" - let l:reset_character_selection = 1 - endif + let l:mode = mode() + let l:reset_visual_selection = l:mode ==? 'v' || l:mode ==# "\<c-v>" + let l:reset_character_selection = l:mode ==? 's' || l:mode ==# "\<c-s>" if g:ale_set_quickfix if !ale#list#IsQuickfixOpen() @@ -61,8 +56,11 @@ function! ale#list#SetLists(buffer, loclist) abort endif if l:reset_visual_selection || l:reset_character_selection + " If we were in a selection mode before, select the last selection. normal! gv + if l:reset_character_selection + " Switch back to Select mode, if we were in that. normal! "\<c-g>" endif endif |