sublime-text-git
sublime-text-git copied to clipboard
Fix GotoDiff for single line only
results in Git 2.10.0 and Beyond Compare 4.1.6
steps:
- add hello.txt with contain "hello world!" and make commit with it
- append "new line" into hello.txt
- run
Git: Diff All Files - stage changes by
Git: Add All - remove line "hello world!"
- run
Git: Diff All Files - stage changes by
Git: Add All - run
Git: Diff Stages Files
output:
--- a/hello.txt +++ b/hello.txt @@ -1 +1,2 @@ -hello world! \ No newline at end of file + hello world! + new line \ No newline at end of file
--- a/hello.txt +++ b/hello.txt @@ -1,2 +1 @@ - hello world! new line \ No newline at end of file
--- a/hello.txt +++ b/hello.txt @@ -1 +1 @@ -hello world! \ No newline at end of file + new line \ No newline at end of file
Press Enter Key on that - or + lines. Dump error message:
No hunk info
How's it broken?
This code is failed for above diffs
hunk = re.match(r"^@@ -(\d+),(\d+) +(\d+),(\d+) @@.*", hunk_line)
I have fixed it and will make pull request later.
pull request #494