mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
Fix: Opening files from diff line when not in project root
When trying to open a file from gd in $EDITOR (alt + e) the wrong file was being opened when the command wasn't executed from the repository's root directory.
This commit is contained in:
parent
6f212fd2b2
commit
76ee5bf803
|
|
@ -242,9 +242,11 @@ _forgit_diff_view() {
|
|||
}
|
||||
|
||||
_forgit_edit_diffed_file() {
|
||||
local input_line=$1
|
||||
local input_line rootdir
|
||||
input_line=$1
|
||||
rootdir=$(git rev-parse --show-toplevel)
|
||||
filename=$(echo "$input_line" | _forgit_get_single_file_from_diff_line)
|
||||
$EDITOR "$filename" >/dev/tty </dev/tty
|
||||
$EDITOR "$rootdir/$filename" >/dev/tty </dev/tty
|
||||
}
|
||||
|
||||
_forgit_diff_enter() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue