lambdalisue / vim-fern

🌿 General purpose asynchronous tree viewer written in Pure Vim script
MIT License
1.29k stars 49 forks source link

Cursor is not restored event after Neovim has closed #207

Closed winkee01 closed 4 years ago

winkee01 commented 4 years ago

neovim open a directory and then type :Fern . to open the browsing view, the cursor type will become verticle bar.

steps:

1) open current directory, my cursor type is box image

2) use :Fern . to browse, now my box cursor becomes vertical bar image

3) exit neovim, but cursor is still vertical bar image

my iterm2's settings for cursor:

image

plugins:

Plug 'antoinemadec/FixCursorHold.nvim'
Plug 'lambdalisue/fern.vim'

OS: Mac OS X, Catalina Terminal: iTerm2 Editor: neovim

PS: I test fern in vim, but it will not change my cursor, so I guess there is some problem with working in neovim?

lambdalisue commented 4 years ago

That's a feature. You can disable it by the following

*g:fern#disable_viewer_hide_cursor*
    Set 1 to disable viewer hide cursor. Note that Neovim prior to 0.5.0
    cannot hide cursor thus the cursor is shown as a vertical bar instead.

https://github.com/lambdalisue/fern.vim/blob/master/doc/fern.txt#L378-L380

lambdalisue commented 4 years ago

Oops. Sorry, I didn't notice the last line

exit neovim, but cursor is still vertical bar

But I could not reproduce. Please write a minimum vimrc and steps to reproduce.

winkee01 commented 4 years ago

1) ~/.vimrc

set nocompatible " must be first
set encoding=utf-8
call plug#begin('~/.vim/plugged')
Plug 'antoinemadec/FixCursorHold.nvim'
Plug 'lambdalisue/fern.vim'
call plug#end()

2) ~/.config/nvim/init.vim

set termguicolors
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
winkee01 commented 4 years ago

I found that if in tmux window, it will reproduce the issue. otherwise ok.

winkee01 commented 4 years ago

Another, it does not display a box cursor even if work "normally", in my case, the effect is like below: image as you can see, there is no cursor, but a highlighted line indicates on which line the cursor is.

lambdalisue commented 4 years ago

Please make it a minimum.

winkee01 commented 4 years ago

the minimun can be

set nocompatible " must be first
set encoding=utf-8

call plug#begin('~/.vim/plugged')
Plug 'antoinemadec/FixCursorHold.nvim'
Plug 'lambdalisue/fern.vim'
call plug#end()
winkee01 commented 4 years ago

hi, are you able to reproduce the issue?

winkee01 commented 4 years ago

g:fern#disable_viewer_hide_cursor in some cases but it seems not work with neovim.

lambdalisue commented 4 years ago

hi, are you able to reproduce the issue?

Unfortunately no.

winkee01 commented 4 years ago

this reproduces on my machine every time. I tested on different machines.

ludamillion commented 4 years ago

When I have some time I'll try to reproduce with a minimum config but I'm also having the exact issues described. I'm currently using Tmux and kitty terminal

lambdalisue commented 4 years ago

Unfortunately, I'm using Tmux on iTerm2 as well but I could not reproduce it...

lambdalisue commented 4 years ago

@winkee01 @ludamillion

The PR description has several topics thus I'd like to make sure if both of your face a real issue

use :Fern . to browse, now my box cursor becomes vertical bar

Another, it does not display a box cursor even if work "normally", in my case, the effect is like below: as you can see, there is no cursor, but a highlighted line indicates on which line the cursor is.

Above are feature. Fern hide cursor in fern buffer so you'll never see cursor on fern buffer (disable this feature by g:fern#disable_viewer_hide_cursor = 1)

So if you are talking about this. The issue is definitely invalid.

exit neovim, but cursor is still vertical bar

This is not feature and I could not reproduce this in the following environment

If you are talking about this. Please make minimum information to reproduce the issue. Additionally, I feel it's kind Neovim's issue rather than fern itself while you said that the cursor is not restored after Neovim has closed.

winkee01 commented 4 years ago

Somehow it works normally today, just don't know why.

lambdalisue commented 4 years ago

Closable?