-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty buffers shown when '-' key is used on files in symlinked directories #53
Comments
Since I observed that in commit 2fddd65 the only non-test change is to use |
I wonder if using |
the solution is recommended by the
diff --git a/lua/dirbuf.lua b/lua/dirbuf.lua
index 3dad030..552402f 100644
--- a/lua/dirbuf.lua
+++ b/lua/dirbuf.lua
@@ -30,7 +30,7 @@ end
-- This exists to ensure that all paths are displayed in a consistent way and
-- to simplify path manipulation logic.
local function normalize_path(path)
- path = vim.fn.simplify(vim.fn.fnamemodify(path, ":p"))
+ path = vim.fn.simplify(vim.fn.resolve(vim.fn.fnamemodify(path, ":p")))
-- On Windows, simplify keeps the path_separator on directories
if path:sub(-1, -1) == fs.path_separator then
path = vim.fn.fnamemodify(path, ":h") |
I think I have found quite an obscure bug in
dirbuf
where empty dirbuf buffers are shown with certain kinds of symlinked directories setups. It's one that I hit reasonably often because I use a lot of symlinks in my config setup. I've bisected dirbuf and I'm almost certain the problem was introduced by commit 2fddd65. I think I've established some reliable recreation steps also:Install NVIM v0.8.0-dev-1109-g72e104142 (although I'm not sure the NeoVim version actually matters). I'm using Arch Linux but I don't think it matters.
Execute the following commands to create a directory structure:
dirbuf-test.vim
in your home directory with these contents (obviously adapt path to wherever you havedirbuf
checked out):Open NeoVim with
nvim --noplugin -u ~/dirbuf-test.vim
. Do not open any files from the command line (this is important).Open
xyz.lua
from the NeoVim command line with:e /tmp/def/ghi/xyz.lua
(it is important to use the symlinked name).Hit
-
Observe that the buffer is empty! (This is supposed to be showing the contents of
/tmp/def/ghi
, so should includexyz.lua
).If you continue to hit
-
, the parent buffers are shown correctly.If I move
dirbuf
to the commit before2fddd65adb
, the problem listed in step (7) does not occur.Since I noted the commit is related to
autochdir
, for the record that option is off for me (the default).Thanks as always for your hard work on dirbuf! Hope the above steps help narrow things down quickly.
The text was updated successfully, but these errors were encountered: