Skip to content

[bug] update_cwd unwanted change to root on first buffer enter #974

Closed
@alex-courtis

Description

@alex-courtis

OS
Arch Linux 5.16.8-arch1-1

Neovim version

NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Nvim-tree version
0f7da14

Describe the bug
After changing to a subdirectory for the first time, entering a buffer results in nvim-tree changing to that parent directory, however its lcd is still the subdirectory.

Subsequest nvim-tree directory changes and buffer enters result in no further unwanted directory changes.

To Reproduce
empty nvim configuration, no plugins othen than nvim-tree

tree.setup {
	update_cwd = true,
}

NvimTreeOpen
change to a subdirectory
select the window with the empty, default buffer
nvim-tree changes its directory back to the root, however pwd indicates that its local directory is still the above subdirectory

asciicast

Expected behavior
nvim-tree's directory is not changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions