1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:30:04 +08:00

Clear cursor highlight when open terminal windows

This commit is contained in:
Shidong Wang 2018-12-27 22:01:04 +08:00
parent 8be2f3919d
commit 044f7806c2

View File

@ -122,7 +122,18 @@ function! s:open_default_shell() abort
if s:default_shell ==# 'terminal'
if exists(':terminal')
if has('nvim')
exe 'terminal'
terminal
" @bug cursor is not cleared when open terminal windows.
" in neovim-qt when using :terminal to open a shell windows, the orgin
" cursor position will be highlighted. switch to normal mode and back
" is to clear the highlight.
" This seem a bug of neovim-qt in windows.
"
" cc @equalsraf
if s:SYSTEM.isWindows && has('nvim')
stopinsert
startinsert
endif
else
if s:SYSTEM.isWindows
let shell = empty($SHELL) ? 'cmd.exe' : $SHELL