Skip to content

Don't Close Window On fs.remove() When Last Buffer In Window #2861

@siduck

Description

@siduck

Problem
When there's just 1 window opened along with nvimtree, then deleting its file from tree, would make nvimtree become fullscreen

Desired behavior
Nvimtree should open unamed buf ( enew ) and then delete, this will maintain the win layout!

 actions = {
    remove_file = {
      open_unamed_buf = true,
    },
  },

Possible solutions with edgecases

The code must be run only when the user presses "y"

Case 1

If there's just 1 listed buffer and its the active window

  • Add empty buffer i.e enew
  • delete

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions