Skip to content

Skip vim.fs.root() fallback to Nvim's current-directory #34208

@Mo-tmd

Description

@Mo-tmd

Problem

Is it reasonable that vim.fs.root() search falls back to Nvim's current-directory for unnamed and special buffers? If for example, current-directory is / or ~ and a marker matches, we might end up with / or ~ as root_dir. To have a root_dir with so many files could be problematic depending on the language server and configuration?

I'd be happy to make a pull request if agreement is reached.

Expected behavior

vim.fs.root() returns nil when source is an unnamed or a special buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions