Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 No syntax highlighting if hunk includes added/removed newline at EOF #1812

Open
injust opened this issue Aug 19, 2024 · 1 comment
Open

Comments

@injust
Copy link
Contributor

injust commented Aug 19, 2024

diff --git i/test.json w/test.json
index d89de76..34d7810 100644
--- i/test.json
+++ w/test.json
@@ -1,4 +1,4 @@
 {
   "foo": "bar",
-  "baz": "qux"
-}
\ No newline at end of file
+  "baz": ""
+}
image
@injust injust changed the title 🐛 No syntax highlighting if hunk includes removed trailing newline 🐛 No syntax highlighting if hunk includes added/removed newline at EOF Aug 19, 2024
@injust
Copy link
Contributor Author

injust commented Aug 19, 2024

This seems to happen if the \ No newline at end of file line appears between the old/new lines in the diff.

Syntax highlighting works in this case:

diff --git i/test.json w/test.json
index 41557a1..eb5fe05 100644
--- i/test.json
+++ w/test.json
@@ -1,4 +1,4 @@
 {
-    "foo": "bar",
+    "foo": "",
     "baz": "qux"
-}
\ No newline at end of file
+}
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant