Skip to content

NvimTree changes root in the other tab after it is reopened #1978

Closed
@carljohnson93

Description

@carljohnson93

Description

When nvim-tree is opened in one tab, then in the other and I change directory with <c-]> there, then go back to previous tab and reopen nvim-tree it loads the directory which I cded into from the other tab.

Neovim version

NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

Artix Linux latest release, also tested on macOS 10.15.7

nvim-tree version

02fdc26

Minimal config

vim.cmd[[
call plug#begin()

Plug 'nvim-tree/nvim-tree.lua'

call plug#begin()
]]

require('nvim-tree').setup()

Steps to reproduce

  1. nvim
  2. :NvimTreeToggle
  3. :tabnew
  4. :NvimTreeToggle
  5. cd into any directory with <c-]>
  6. :tabprev
  7. :NvimTreeToggle
  8. :NvimTreeToggle

Expected behavior

Expected for nvim tree to reopen its window and load same directory I was in just before closing it in this tab

Actual behavior

nvim-tree loads the last opened directory, in this case the one we cded into from the other tab

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreproducedIssue confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions