Closed jesseleite closed 4 years ago
If no buffers are open, instead of showing an error it falls back to :Fern .
I'm not sure why you need to fallback to :Fern .
when no buffers are opened. Fern does not claim when a path specified to -reveal
exists so you can simply use :Fern . -reveal=%
in both case.
If the open buffer is not within the current working directory, reveal the file within it's parent folder instead.
I feel it's quite personal behavior. I think it's better to write a tips on Wiki rather than providing the functionality.
I'm not sure why you need to fallback to :Fern . when no buffers are opened. Fern does not claim when a path specified to -reveal exists so you can simply use :Fern . -reveal=% in both case.
Well the idea is that I don't want to have to setup two mappings for :Fern .
and :Fern . -reveal=%
. If I use :Fern . -reveal=%
in both cases, I see an error when no buffers are open. Say a user opens a fresh instance of Vim and decides to hit their single :Fern . -reveal=%
mapping to open their first file, they'll see this error...
I'm falling back to :Fern .
to avoid showing that error. Or would you consider that error a bug?
If the open buffer is not within the current working directory, reveal the file within it's parent folder instead. [...] I feel it's quite personal behavior. I think it's better to write a tips on Wiki rather than providing the functionality.
That point is fair; I can see how that's maybe a bit more subjective 🙂
they'll see this error...
Thanks. I've forgotten that error. Now what you said makes sense.
Or would you consider that error a bug?
It's.... not a bug but I agree that it's much easier if the error is not raised. I'll try to make Fern . -reveal=%
avoids E499 automatically.
@lambdalisue interesting, I don't get the error with that minimal vimrc either. I'll see if I can find the conflicting config and will get back to you. Thanks!
Would you consider adding a reveal command something like this? I've been using the below script for a bit and love it. I'm sure my vimscript could be cleaned up, but the idea is this...
:FernReveal
is simpler for users to map to, compared to:Fern . -reveal=%
:Fern .
Thoughts?