NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
3.71k stars 221 forks source link

Fix the ability to open files from within neogit when cwd is set to a subdirectory or external location, fixes Issue #1140 #1283

Closed cjgibbons closed 2 months ago

cjgibbons commented 2 months ago

This PR fixes the bug in Issue #1140.

The problem stems from the default directory being returned instead of the detected .git's parent directory. This issue existed prior to PR #1281, but is now properly fixed in this PR.

Specifically, the text of plenary.job's job_output is in a table element retrieved by calling result() against the table.

With this PR the proper directory top-level is returned wherever cwd is defined, including sub-directories, and it also fixes the behavior with cwd=%:p:h so that opening files in the subdirectory returns the correct path and one can still open files above the defined cwd from within Neogit.

CKolkey commented 2 months ago

Thanks for the follow up :)