summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Clark <kevin.clark@gmail.com>2021-04-12 00:57:14 -0700
committerGitHub <noreply@github.com>2021-04-12 16:57:14 +0900
commit1cd0c0c33b211b5fface9b29f9c58bc6ae09323e (patch)
tree7d09e4efd27cef1f0124d54a7a011c0617c020b7
parent686c8c5e0acbf3cbf50f1b11eafadd759b017f4a (diff)
downloadale-1cd0c0c33b211b5fface9b29f9c58bc6ae09323e.zip
Don't exit visual mode on floating preview close (#3689)
-rw-r--r--autoload/ale/floating_preview.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/autoload/ale/floating_preview.vim b/autoload/ale/floating_preview.vim
index 4caf3f9d..729e04b4 100644
--- a/autoload/ale/floating_preview.vim
+++ b/autoload/ale/floating_preview.vim
@@ -113,6 +113,9 @@ function! s:Create(options) abort
endfunction
function! s:Close() abort
+ let l:mode = mode()
+ let l:restore_visual = l:mode is# 'v' || l:mode is# 'V' || l:mode is# "\<C-V>"
+
if !exists('w:preview')
return
endif
@@ -124,4 +127,8 @@ function! s:Close() abort
endif
unlet w:preview
+
+ if l:restore_visual
+ normal! gv
+ endif
endfunction