Skip to content

When toggling the draw with reveal, subsequent reveals of the same file name do not get revealed #136

@nickjj

Description

@nickjj

Repeatable steps:

  1. Create a mapping of noremap <silent> <Leader>f :Fern . -drawer -reveal=% -toggle -width=35<CR><C-w>= (thanks @bluz71)

  2. Set up something to test with

mkdir -p /tmp/testfern \
  && touch /tmp/testfern/foo \
  && touch /tmp/testfern/bar
  1. cd /tmp/testfern && vim .

  2. In Vim :e foo

  3. Use custom mapping to toggle fern open

  4. Notice how foo is selected

  5. Use custom mapping to toggle fern closed

  6. Use custom mapping to toggle fern open

  7. Notice how foo is no longer selected, instead the first item in the tree is which is the testfern directory

There's other potentially related issues too, like if you semi-randomly start clicking foo and bar to open them in a single pane and toggle the draw a few times, sometimes the wrong file will be revealed. I can't reproduce this exactly, but it happens often. This is different than the repeatable steps because in this case it reveals and highlights the wrong file, not the root item in the tree. This is more easily tested by adding the contents "foo" and "bar" to each file so you can see the foo file being open but the bar item is revealed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions