Skip to content

Commit

Permalink
fix GotoDiff when no file path is found
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Narretz committed Mar 25, 2015
1 parent aa1b104 commit 6e84b7c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ def run(self, edit):
else:
git_root_dir = ""

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

0 comments on commit 6e84b7c

Please sign in to comment.