lambdalisue / vim-fern

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

Fern showing error if it is opened during loading the session.vim (but works just fine) #291

Closed krehwell closed 3 years ago

krehwell commented 3 years ago

The error occur if the session saved is with the fern opened. and when trying to load that session with vim -S session.vim the errors pop up on opening as shown below:
image

it works just fine after pressing enter with the fern still opened as the session saved previously. however it's could maybe better if the errors does not pops up.

lambdalisue commented 3 years ago

It's Vim's feature. See :help persistent-undo and delete the undofile by yourself.

jonescamilla commented 3 years ago

I'm encountering the same issue. I'm also uncertain on how undo files are the issue or what lead to the issue. With undo files turned off, the undo files directory empty, and newly created sessions afterward. I still encounter the issue.

I've tried to natively save sessions and through plugins and encounter the exact same "error".

"fern://drawer:1/file:///Users/admin/git/dotfiles/nvim;width=25$" [Not edited] --No lines in buffer--

At times the session loads normally and I am able to use nvim like regular and on other instances fern covers the entire "document"

@krehwell were you able to find a solution? and @lambdalisue any additional hints?

Thank you in advance!

krehwell commented 3 years ago

no I haven't found any solution, I just let it be since the error just pop up but has no effect to my session project. maybe we can ignore some vim error on openbuf maybe? I dunno

lambdalisue commented 3 years ago

Hum... I thought it's undo-persistent feature thus deleting the file is enough to fix the issue If you didn't try that, try. Otherwise give me

Start from https://github.com/lambdalisue/fern.vim/issues/290#issuecomment-769325553

jonescamilla commented 3 years ago

Thank you both for your responses!

I'll comment a minimum nvim config to reproduce as soon as I'm free.

I should add that loading saved sessions does not give issues when fern is closed before saving the session: Fern open before saving leads to that issue. Fern closed before saving leads to no issues.

And thank you for this amazing tool!

jonescamilla commented 3 years ago

I've made a very bare repo that holds the init.vim and a readme that should walk you through the process. I was able to reproduce the error with that same repo. I've also included my additional fern configurations in the chance that they affect the error occurring.

lambdalisue commented 3 years ago

Please make that vimrc minimal first.

jonescamilla commented 3 years ago

Please make that vimrc minimal first.

Updated repo.

lambdalisue commented 3 years ago

CleanShot 2021-02-16 at 20 34 15

If you are talking about the line above, that's Vim's feature. That line tells that the fern buffer has no content (while fern is asynchronous plugin) like "LICENSE" or "README.md" lines which is also restored buffers in my case.

jonescamilla commented 3 years ago

I now know that the issue is no longer in the scope of JUST fern.vim. But would you have a suggestion on how to disable such a notification for us? If not, I still appreciate the time and response!

Thank you

lambdalisue commented 3 years ago

I'm sorry but I've no idea. That message is produced by :edit {filename} command on Vim thus you may able to disable such message in some way I guess.

Shougo commented 3 years ago

You can disable the messages by shortmess option.

Shougo commented 3 years ago
      F don't give the file info when editing a file, like `:silent`
        was used for the command; note that this also affects messages
        from autocommands
lambdalisue commented 3 years ago

@jonescamilla

iamvoidcoder commented 3 years ago

Those of you who sorted the issue. Can you please share some details. I'm trying

set shortmess+=F

in my init.vim and it doesn't suppress "--No lines in buffer--" at startup :(