Skip to content

sync_root_with_cwd appears to be broken #2689

@SOberhoff

Description

@SOberhoff

Description

If one opens a new buffer after having changed the current working directory through nvim-tree's sync_root_with_cwd option, then :pwd while in the new buffer will print the directory neovim was originally opened in, not the new current working directory.

Neovim version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377

Operating system and version

macOS 14.3.1

Windows variant

No response

nvim-tree version

d52fdeb

Clean room replication

require("nvim-tree").setup({sync_root_with_cwd = true})

Steps to reproduce

  1. Launch neovim in directory foo.
  2. Use <C+]> to navigate to foo/bar.
  3. Open foo/bar/README.md
  4. Run :pwd

Expected behavior

:pwd returns foo/bar.

Actual behavior

:pwd returns foo.

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