sublime-text-git icon indicating copy to clipboard operation
sublime-text-git copied to clipboard

Fix GotoDiff for single line only

Open watergear opened this issue 9 years ago • 3 comments

results in Git 2.10.0 and Beyond Compare 4.1.6

steps:

  1. add hello.txt with contain "hello world!" and make commit with it
  2. append "new line" into hello.txt
  3. run Git: Diff All Files
  4. stage changes by Git: Add All
  5. remove line "hello world!"
  6. run Git: Diff All Files
  7. stage changes by Git: Add All
  8. 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

watergear avatar Sep 28 '16 01:09 watergear

How's it broken?

kemayo avatar Sep 28 '16 01:09 kemayo

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.

watergear avatar Sep 28 '16 01:09 watergear

pull request #494

watergear avatar Sep 28 '16 02:09 watergear