Closed nickjj closed 3 years ago
Not sure if it's help but you may want to disable that feature by https://github.com/lambdalisue/fern.vim/blob/master/doc/fern.txt#L432
I'll read it more carefully later but it seems difficult to determine if the size change is caused by user or unexpected buffer relocation.
Additionally, for your case, there are two useful actions
fern-action-zoom:half
fern-action-zoom:full
If I set let g:fern#disable_drawer_auto_resize = 1
then this happens (step 6 is different):
Fern resizes itself to be 50% of the size of the entire Vim window and even if you resize it again, it always goes back to 50%
That's probably different issue and it sounds like <C-w>=
is automatically fired in somewhere?
Please make a new issue with a minimal vimrc and procedure if you feel that behavior is caused by fern itself.
That's probably different issue and it sounds like
<C-w>=
is automatically fired in somewhere?
I removed that and it's still the same issue where it snaps to 50% of the size.
I'll be completely honest with you. I really like Fern and have been using it for ~6 months and you've gone above and beyond in a lot of cases to fix bugs, add features and I'm grateful for that but this resize issue is killing me.
It's very disruptive when creating video tutorials and giving talks because if I have Fern open and I'm switching between 2 files while talking about the code in real time I have to constantly resize Fern every time I switch between 2 files in order to make sure the full file name is visible (since I would drag it a little wider manually to see it). It causes a lot of stress when giving live talks and in some cases has ruined a number of videos where I had to go back and re-do them.
Any help on how to fix / resolve this would be much appreciated.
I could not reproduce https://github.com/lambdalisue/fern.vim/issues/309#issuecomment-791923964
Please make a minimal vimrc and minimal descriptive steps to reproduce. Visit the above link and follow the instruction there.
What I did is
" Disable Vim's native pack feature
set packpath=
" Clone https://github.com/lambdalisue/fern.vim in somewhere
" and specify that directory to the below
set runtimepath^=~/ghq/github.com/lambdalisue/fern.vim
filetype plugin indent on
syntax on
"----------------------------------------------------------------
" Add extra settings here to reproduce the issue...
let g:fern#disable_drawer_auto_resize = 1
"----------------------------------------------------------------
echomsg "Custom minimal vimrc has loaded"
Then
nvim -u ~/vimrc.min
:Fern . -drawer -reveal=% -toggle -width=35
:vertical resize 100
<C-w>l
<C-w>h
https://user-images.githubusercontent.com/546312/116719249-d20c7900-aa15-11eb-8a8c-3b939770f549.mp4
Your steps are different than mine because you're not toggling Fern on and off.
Try these steps (altering your steps):
nvim -u ~/vimrc.min
:Fern . -drawer -reveal=% -toggle -width=35
:vertical resize 100
:Fern . -drawer -reveal=% -toggle -width=35
(this will close Fern):Fern . -drawer -reveal=% -toggle -width=35
(this will open Fern at 50% width instead of step 3's size)The issue is step 5 should not resize the window to 50%. It should continue using the custom width defined by step 3.
Now, finally, I got the situation. Please remember that steps with actual commands like what you've given me last are quite important for understanding the situation...
Well, it's a kind feature of g:fern#disable_drawer_auto_resize
while the buffer is closed so we need a new feature for that. I'll think about it.
@nickjj https://github.com/lambdalisue/fern.vim/pull/332 Please give me feedback on that PR.
Which combination of options should I use? When I set both options to 1 it still snaps to 50% width in the repeatable steps.
@nickjj
Which combination of options should I use? When I set both options to 1 it still snaps to 50% width in the repeatable steps.
You should not use g:fern#disable_drawer_auto_resize
. The original behavior has changed.
Anyway, please try #333 instead which also changed the default behavior.
With #333 f I remove those 2 settings and:
<CR>
Then fern will reset its width to my configured 35 width instead of 50% this time. This is still an issue. But your repeatable steps without <CR>
seems to work.
I'm sorry but I cannot reproduce the issue with that information. I need to reproduce the issue on my environment to fix that issue.
I like the idea and I'd love to help your situation so please create a minimal vimrc and write minimal and descriptive procedure like what you gave me yesterday so that I can reproduce the issue.
Those steps are how I'm able to reproduce the issue with Vim 8.1 btw. The only difference now is instead of running the command directly, it's bound to a key with <CR>
with noremap <silent> <Leader>f :Fern . -drawer -reveal=% -toggle -width=35<CR>
and instead of running the resize command directly you move and select files with the mouse.
I'm sorry but I'm lost so
I am expecting that your comment will look like
vimrc
" Disable Vim's native pack feature
set packpath=
" Clone https://github.com/lambdalisue/fern.vim in somewhere
" and specify that directory to the below
set runtimepath^=~/ghq/github.com/lambdalisue/fern.vim
filetype plugin indent on
syntax on
"----------------------------------------------------------------
" Add extra settings here to reproduce the issue...
"----------------------------------------------------------------
echomsg "Custom minimal vimrc has loaded"
procedure
nvim -u ~/vimrc.min
:Fern . -drawer -reveal=% -toggle -width=35
:vertical resize 100
:Fern . -drawer -reveal=% -toggle -width=35
(this will close Fern):Fern . -drawer -reveal=% -toggle -width=35
(this will open Fern at 50% width instead of step 3's size)Please copy & paste instead of referring even if something has not changed to make things clear.
@nickjj I merged #333 so please create a new issue with minimal vimrc and procedure when you still have some issues.
Thanks, I'll try it again but when I did before I was able to reproduce the issue once in a while with #333, but not always. I wonder if it's due to some combo of clicking, dragging and focusing windows that makes it reset the width.
Hi,
I typically open fern with
noremap <silent> <Leader>f :Fern . -drawer -reveal=% -toggle -width=35<CR><C-w>=
Steps to reproduce potential issue:
At this point fern will revert the customize size you manually dragged fern to and resize it based on your mapping.
This is problematic for me as someone who creates video recorded content. I often find myself wanting to make fern a little bit wider so I can see the full file name (this changes based on the length of file name), but every time I click back into the code and then back into fern, fern snaps to its original size and then I need to manually make it wider again. I had to do this manual resize "fix" about 10 times in a 5 minute video while jumping between files and explaining stuff.
Would it be possible to write a rule that says "if fern is already open and visible, do not adjust the size to the configured
-width
, instead leave it at whatever width it's currently at". And if fern is closed and toggling to be opened it would work as it does now and correctly open at your configured-width
.