Skip to content

Commit 5fe781e

Browse files
authored
Merge pull request #340 from lambdalisue/fix-macvim
Fix cursor hide in GUI vim
2 parents 5409f2e + c3673ab commit 5fe781e

File tree

1 file changed

+29
-31
lines changed

1 file changed

+29
-31
lines changed

autoload/fern/internal/cursor.vim

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,35 @@ function! fern#internal#cursor#restore() abort
99
call s:restore()
1010
endfunction
1111

12-
if has('nvim')
13-
if has('nvim-0.5.0')
14-
" https://github.com/neovim/neovim/issues/3688#issuecomment-574544618
15-
function! s:hide() abort
16-
set guicursor+=a:FernTransparentCursor/lCursor
17-
endfunction
18-
19-
function! s:restore() abort
20-
set guicursor+=a:Cursor/lCursor
21-
let &guicursor = s:guicursor_saved
22-
endfunction
23-
24-
function! s:highlight() abort
25-
highlight default FernTransparentCursor gui=strikethrough blend=100
26-
endfunction
27-
call s:highlight()
28-
29-
augroup fern_internal_cursor
30-
autocmd!
31-
autocmd ColorScheme * call s:highlight()
32-
augroup END
33-
else
34-
" No way thus use narrow cursor instead
35-
function! s:hide() abort
36-
set guicursor+=a:ver1
37-
endfunction
38-
39-
function! s:restore() abort
40-
let &guicursor = s:guicursor_saved
41-
endfunction
42-
endif
12+
if has('nvim-0.5.0')
13+
" https://github.com/neovim/neovim/issues/3688#issuecomment-574544618
14+
function! s:hide() abort
15+
set guicursor+=a:FernTransparentCursor/lCursor
16+
endfunction
17+
18+
function! s:restore() abort
19+
set guicursor+=a:Cursor/lCursor
20+
let &guicursor = s:guicursor_saved
21+
endfunction
22+
23+
function! s:highlight() abort
24+
highlight default FernTransparentCursor gui=strikethrough blend=100
25+
endfunction
26+
call s:highlight()
27+
28+
augroup fern_internal_cursor
29+
autocmd!
30+
autocmd ColorScheme * call s:highlight()
31+
augroup END
32+
elseif has('nvim') || has('gui_running')
33+
" No way thus use narrow cursor instead
34+
function! s:hide() abort
35+
set guicursor+=a:ver1
36+
endfunction
37+
38+
function! s:restore() abort
39+
let &guicursor = s:guicursor_saved
40+
endfunction
4341
else
4442
" Vim supports 't_ve'
4543
function! s:hide() abort

0 commit comments

Comments
 (0)