Skip to content

Closing a window and opening a file moves Neo-tree to the wrong place #576

@lateef-k

Description

@lateef-k

Hello, love the plugin. Have a small issue. Neo-tree should stay on the left, however the following happens:

Scenario (A)

1.Open an empty buffer, then open Neo-tree with
:Neotree position=left toggle=true action=focus<CR>
2. At this point only Neo-tree on the left, and an empty buffer on the right are on the screen.
3. Close the empty window with :q
4. Open another file in Neo-tree
5. Notice how Neo-tree now opens on the right.

Scenario (B)

I have an autocmd which opens Neo-tree whenever I open nvim on a directory. I don't depend on Neo-tree's own hijacking behavior for 2 reasons, (1) I've disabled netrw (2) I'm lazy loading Neo-tree on the Neotree command. This is the autocmd:

autocmd BufEnter * if isdirectory(expand("%")) | enew | Neotree

The same problem as Scenario (A) exists, however it also happens when you close the buffer. In scenario (A) closing the buffer doesn't close the window, but in in (B) it does. So you end up with the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions