Don't exit visual mode on floating preview close (#3689)

This commit is contained in:
Kevin Clark 2021-04-12 00:57:14 -07:00 committed by GitHub
parent 686c8c5e0a
commit 1cd0c0c33b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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