From 1cd0c0c33b211b5fface9b29f9c58bc6ae09323e Mon Sep 17 00:00:00 2001 From: Kevin Clark Date: Mon, 12 Apr 2021 00:57:14 -0700 Subject: Don't exit visual mode on floating preview close (#3689) --- autoload/ale/floating_preview.vim | 7 +++++++ 1 file changed, 7 insertions(+) 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# "\" + 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 -- cgit v1.2.3