Skip to content

fix(files): ensure reveal_cwd also works when / is cwd#2444

Merged
echasnovski merged 1 commit into
nvim-mini:backlogfrom
abeldekat:fix_files_reveal
Jun 2, 2026
Merged

fix(files): ensure reveal_cwd also works when / is cwd#2444
echasnovski merged 1 commit into
nvim-mini:backlogfrom
abeldekat:fix_files_reveal

Conversation

@abeldekat
Copy link
Copy Markdown
Member

Resolve #2443

Copy link
Copy Markdown
Member

@echasnovski echasnovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

This does fix the error, but to fix the behavior there needs to be another adjustment in reveal_cwd itself.

@abeldekat, I am okay with you fixing this for educational purposes for a day or two. If you are short on time or motivation, I already have almost full fix with tests (started on it before seeing your comment in the issue).

Comment thread lua/mini/files.lua Outdated
Comment thread tests/test_files.lua Outdated
@abeldekat
Copy link
Copy Markdown
Member Author

@abeldekat, I am okay with you fixing this for educational purposes for a day or two. If you are short on time or motivation, I already have almost full fix with tests (started on it before seeing your comment in the issue).

I indeed missed that the reveal does not work when cwd is /.
Having both time and motivation. Thanks!

@abeldekat abeldekat changed the title fix(files): ensure reveal_cwd also works when / is open fix(files): ensure reveal_cwd also works when / is root Jun 2, 2026
@abeldekat abeldekat changed the title fix(files): ensure reveal_cwd also works when / is root fix(files): ensure reveal_cwd also works when / is cwd Jun 2, 2026
Copy link
Copy Markdown
Member

@echasnovski echasnovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this looks much better now!

Comment thread lua/mini/files.lua Outdated
Comment thread tests/test_files.lua Outdated
Comment thread tests/test_files.lua Outdated
Comment thread tests/test_files.lua Outdated
@echasnovski echasnovski changed the base branch from main to backlog June 2, 2026 12:57
@echasnovski echasnovski merged commit 8867589 into nvim-mini:backlog Jun 2, 2026
10 of 11 checks passed
@echasnovski
Copy link
Copy Markdown
Member

Thanks!

I've adjusted the set_branch() test to actually test that it successfully sets the expected branch. It is also a test for the error since the test would not have been successful if there was an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: branch contains not a parent-child pair: "/" and "/home"`on reveal cwd when parent is top-level directory is /

2 participants