Skip to content

Commit

Permalink
Merge pull request #186 from lambdalisue/fix-cursor-issues
Browse files Browse the repository at this point in the history
Fix cursor issues
  • Loading branch information
lambdalisue authored Aug 31, 2020
2 parents 9e5aab0 + 2b3a601 commit 72be136
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/fern/internal/viewer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function! s:init() abort
if !g:fern#disable_viewer_hide_cursor
autocmd BufEnter,WinEnter,CmdwinLeave,CmdlineLeave <buffer> setlocal cursorline
autocmd BufEnter,WinEnter,CmdwinLeave,CmdlineLeave <buffer> call fern#internal#cursor#hide()
autocmd BufLeave,WinLeave,CmdwinEnter,CmdlineEnter <buffer> call fern#internal#cursor#restore()
autocmd BufLeave,WinLeave,CmdwinEnter,CmdlineEnter,VimLeave <buffer> call fern#internal#cursor#restore()
endif
augroup END

Expand Down
7 changes: 7 additions & 0 deletions ftplugin/fern.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ let b:did_ftplugin = 1

setlocal cursorline
setlocal nolist nowrap nospell

" Do NOT allow cursorlineopt=number while fern.vim hide cursor on
" its buffer unless g:fern#disable_viewer_hide_cursor has specified
" Fix #182
if exists('+cursorlineopt') && !g:fern#disable_viewer_hide_cursor
setlocal cursorlineopt=number,line
endif

0 comments on commit 72be136

Please sign in to comment.