gornostal / Modific

Highlight lines changed since the last commit (supports Git, SVN, Bazaar, Mercurial and TFS) / ST2(3) plugin
614 stars 44 forks source link

Removing last line causes the plugin to ignore all other added lines #19

Closed spaze closed 12 years ago

spaze commented 12 years ago

Hi!

When last (empty) line of the file is removed and some other lines are added, Modific does not highlight them in the editor.

Running the diff manually svn diff --internal-diff service.yaml gives the following diff:

[...]
@@ -69,4 +74,14 @@
     columns: [owner]
     unique: false
     access_method: btree
-
+foreign_keys:
+    fk_key_number:
+        columns: key_number
+        references:
+            table: number_pool
+            columns: id_number
+    fk_ikey_endpoint_type:
+        columns: ikey_endpoint_type
+        references:
+            table: classificator
+            columns: key_integer

(notice the -, the removed line)

When I keep the line there so that the diff looks like

@@ -70,3 +75,14 @@
     unique: false
     access_method: btree

+foreign_keys:
+    fk_key_number:
+        columns: key_number
+        references:
+            table: number_pool
+            columns: id_number
+    fk_ikey_endpoint_type:
+        columns: ikey_endpoint_type
+        references:
+            table: classificator
+            columns: key_integer

I see nice dots next to the added lines.

(sorry for not providing a patch)

gornostal commented 12 years ago

It's weird. I don't have such problem.

Please, try another file. Write me what you will get.

spaze commented 12 years ago

Had the problem with four other (although similar) files. Will try harder to find a pattern.

gornostal commented 12 years ago

Try to look in the console. Maybe you'll find an error.

gornostal commented 12 years ago

It's strange that you get minus here

     access_method: btree
-
+foreign_keys:
+    fk_key_number:
+        columns: key_number
+        references:

When I replace last empty line with some content I only get pluses.

gornostal commented 12 years ago

What OS do you use?

spaze commented 12 years ago

It's Win7, although the files have Linux EOLs (via svn:eol-style=LF property). If the file ends with two newlines (so there's one empty line at the end - the file ends with 0A 0A in hex) you get one deleted line and then several added, if you replace the last empty line.

When the empty line stays there, and I add three lines at the end, I see the "added" markers and the console says [34, 35, 36] [] [] when I keep those three lines there and remove the empty line it says [] [33, 34, 35] [] instead and I don't see any "added" markers.

gornostal commented 12 years ago

OK. I will try to reproduce this bug on a Windows machine.

gornostal commented 12 years ago

@spaze Could you send me a file, where you see this issue? I've check on Windows, and everything still works fine.

spaze commented 12 years ago

Sure, one of the files is here: https://dl.dropbox.com/u/20451634/user_number_data_status.yaml (md5sum 35d66b8ecf6773a061d6627e0d931b3b)

gornostal commented 12 years ago

Sorry, I could not reproduce this issue :( Maybe it's not a problem of line endings. More likely you have issue #9. Have you ever experienced disappearing of tabs row or a cursor?

I think so, because disappearing of icons in the gutter is one of symptoms of the issue #9. Besides, as you've mentioned before, Modific prints to log numbers of modified rows.

spaze commented 12 years ago

Yeah, seems to be related to issue #9. Today, I could not reproduce it anymore, the icons were correctly indicating everything and I did not experience missing tabs. I've also changed the theme to Soda Dark few days ago.

Right now I've changed the theme back to default and tabs started dissapearing again (even right after restart) and Modific icons were missing at the end of the file. So yeah, seems really related.

gornostal commented 12 years ago

OK. I close this issue.