kana / vim-gf-diff

Vim plugin: Go to the changed block under the cursor from diff output
14 stars 4 forks source link

Added b:vim_gf_diff_base_directory #4

Open ColinKennedy opened 8 months ago

ColinKennedy commented 8 months ago

When using vim-fugitive, the :Git add -p command drops into a diff terminal. This diff view shows paths that are relative to the root of the git repository but I'm frequently cd'ed somewhere else, which causes gf to fail. To make sure gf always works in this case, I added a root directory that points to the git repository root, using b:vim_gf_diff_base_directory. It works for me but I made this PR in case you find it useful