-
Notifications
You must be signed in to change notification settings - Fork 347
Fix font-lock-warning-face regular expression #499
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
Conversation
The regular expression was incorrectly matching `=======` without a space afterwards, so headings were being incorrectly colored as warnings.
Fix font-lock-warning-face regular expression for git merge conflict markers
Merged! Thanks! @bryangarza: Do you see any other obvious mistakes you could help fixing in |
Not yet, but I'll keep an eye out for more fixes 👍 |
This is going to cause problems with git and darcs error hunks (which is why I believe it was added, along with the lines above and below). |
@ivan-m: good catch, for reference
Official git definition is here: http://git-scm.com/docs/git-merge. @bryangarza: Are you able to create a patch so that it matches the above? Please use '$' instead of '\n' as this is more correct. |
Hmm, still the base maker regexp does not look correct when looking at git-merge site... @bryangarza: can you find what is the real definition of a git marker? |
@gracjan here's the patch. From what I can tell, the From 44865d11f64c795f39cd2a915e359f3f9d39acf1 Mon Sep 17 00:00:00 2001
From: Bryan Garza <[email protected]>
Date: Wed, 11 Mar 2015 11:01:51 -0700
Subject: [PATCH] Correct marker regexes
`>>>>>>>` and `<<<<<<<` have text after, but `|||||||` and `=======`
do not.
---
haskell-font-lock.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/haskell-font-lock.el b/haskell-font-lock.el
index 2df19b8..932b833 100644
--- a/haskell-font-lock.el
+++ b/haskell-font-lock.el
@@ -372,7 +372,8 @@ Returns keywords suitable for `font-lock-keywords'."
`(;; NOTICE the ordering below is significant
;;
("^<<<<<<< .*$" 0 'font-lock-warning-face t)
- ("^======= .*$" 0 'font-lock-warning-face t)
+ ("^|||||||$" 0 'font-lock-warning-face t) ; "diff3" style
+ ("^=======$" 0 'font-lock-warning-face t)
("^>>>>>>> .*$" 0 'font-lock-warning-face t)
("^#.*$" 0 'font-lock-preprocessor-face t)
--
2.3.2 |
@bryangarza: it is easier for me to handle proper PR and you get to record your name in the history forever! |
Sounds good, here's the new PR: #501. |
The regular expression was incorrectly matching
=======
without aspace afterwards, so headings were being incorrectly colored as
warnings.