Skip to content

Suggestion to not auto-resize Fern if it's already toggled open and you resized it manually #309

@nickjj

Description

@nickjj

Hi,

I typically open fern with noremap <silent> <Leader>f :Fern . -drawer -reveal=% -toggle -width=35<CR><C-w>=

Steps to reproduce potential issue:

  1. Toggle fern open using the above mapping
  2. It will open at its correct size (working as intended)
  3. You manually resize fern by making it bigger or smaller
  4. You click into a code buffer that isn't fern
  5. You click back into fern

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions