Skip to content

Commit 9bd9e9f

Browse files
committed
fix GotoDiff when no file path is found
Git manual hunk editing files identify as diff, but lack the file path. For manual hunk ediiting, it's also useful to use the default Enter behavior, so we fall back to it if no file path is found. Fixes #407
1 parent aa1b104 commit 9bd9e9f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

diff.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ def run(self, edit):
141141
else:
142142
git_root_dir = ""
143143

144-
if not os.path.isfile(full_path_file_name):
144+
if full_path_file_name is None
145+
# If no path exists, this is a manual hunk editing diff
146+
# fall back to default "Enter" command
147+
self.view.run_command('insert', {'characters':'\n'})
148+
elif not os.path.isfile(full_path_file_name):
145149
caption = "Enter base directory for file '%s':" % self.file_name
146150
v.window().show_input_panel(caption,
147151
git_root_dir,

0 commit comments

Comments
 (0)