Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 29 additions & 31 deletions autoload/fern/internal/cursor.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,35 @@ function! fern#internal#cursor#restore() abort
call s:restore()
endfunction

if has('nvim')
if has('nvim-0.5.0')
" https://github.com/neovim/neovim/issues/3688#issuecomment-574544618
function! s:hide() abort
set guicursor+=a:FernTransparentCursor/lCursor
endfunction

function! s:restore() abort
set guicursor+=a:Cursor/lCursor
let &guicursor = s:guicursor_saved
endfunction

function! s:highlight() abort
highlight default FernTransparentCursor gui=strikethrough blend=100
endfunction
call s:highlight()

augroup fern_internal_cursor
autocmd!
autocmd ColorScheme * call s:highlight()
augroup END
else
" No way thus use narrow cursor instead
function! s:hide() abort
set guicursor+=a:ver1
endfunction

function! s:restore() abort
let &guicursor = s:guicursor_saved
endfunction
endif
if has('nvim-0.5.0')
" https://github.com/neovim/neovim/issues/3688#issuecomment-574544618
function! s:hide() abort
set guicursor+=a:FernTransparentCursor/lCursor
endfunction

function! s:restore() abort
set guicursor+=a:Cursor/lCursor
let &guicursor = s:guicursor_saved
endfunction

function! s:highlight() abort
highlight default FernTransparentCursor gui=strikethrough blend=100
endfunction
call s:highlight()

augroup fern_internal_cursor
autocmd!
autocmd ColorScheme * call s:highlight()
augroup END
elseif has('nvim') || has('gui_running')
" No way thus use narrow cursor instead
function! s:hide() abort
set guicursor+=a:ver1
endfunction

function! s:restore() abort
let &guicursor = s:guicursor_saved
endfunction
else
" Vim supports 't_ve'
function! s:hide() abort
Expand Down