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

Lines starting with -- are not highlighted when called by git commit -v #3693

Closed
sshilovsky opened this issue Sep 4, 2022 · 0 comments · Fixed by #3708
Closed

Lines starting with -- are not highlighted when called by git commit -v #3693

sshilovsky opened this issue Sep 4, 2022 · 0 comments · Fixed by #3708
Assignees
Labels
A-tree-sitter Area: Tree-sitter C-bug Category: This is a bug upstream

Comments

@sshilovsky
Copy link

sshilovsky commented Sep 4, 2022

Summary

When a line starting with - is removed from a source file, the corresponding diff line starts with double -.

It's not highlighted in the editor.

Reproduction Steps

$ cd $(mktemp -d)
$ git init
$ echo "-1" > a
$ git add a
$ git commit a -m1
$ truncate --size 0 a
$ GIT_EDITOR=$(which hx) git commit a -v

The following content is opened:


# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch main
# Changes to be committed:
#	modified:   a
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git a/a b/a
index 3a2e3f4..e69de29 100644
--- a/a
+++ b/a
@@ -1 +0,0 @@
--1

The last line (--1) designates a removed line, and should be highlighted (usually with red font), but it's not. It doesn't have to be the last line for this to happen.

Helix log

~/.cache/helix/helix.log
2022-09-05T02:07:10.096 helix_view::editor [ERROR] Failed to initialize the LSP for `git.commitmsg` { LSP not defined }

Platform

Linux

Terminal Emulator

alacritty 0.10.1 ()

Helix Version

helix 22.08 (ee94031)

@sshilovsky sshilovsky added the C-bug Category: This is a bug label Sep 4, 2022
@the-mikedavis the-mikedavis self-assigned this Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tree-sitter Area: Tree-sitter C-bug Category: This is a bug upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants