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

Fix goto diff for single line only (base on Git 2.10.0).

Open watergear opened this issue 9 years ago • 1 comments

issue #493

like:

--- 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

watergear avatar Sep 28 '16 02:09 watergear

Hi, @kemayo

I sincerely hope you can take the time to look at my problem and try to merge it.

Sometimes the displayed text of diff with single line. Then the line header looks like the following, @@ -1 +1,2 @@ @@ -1,2 +1 @@ @@ -1 +1 @@

In that case, press Enter Key on that - or + lines. Dump error message:

No hunk info

I observed single line mark looks like xx and multiple lines mark looks like xx,xx So I updated the regular text pattern to fit it. from: "^@@ -(\d+),(\d+) +(\d+),(\d+) @@." to: "^@@ -(\d+)(,(\d+))? +(\d+)(,(\d+))? @@."

I hope this fix will help this plugin to make better use of Git.

Thanks wategear

watergear avatar Jan 12 '18 04:01 watergear