emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/go-mode f9174b2 458/495: Improve go-dot-mod-mode font lock


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode f9174b2 458/495: Improve go-dot-mod-mode font lock regexp
Date: Sat, 7 Aug 2021 09:06:08 -0400 (EDT)

branch: elpa/go-mode
commit f9174b22aee956dd9a1a875b46bdadb281a912cb
Author: Peter Sanford <psanford@sanford.io>
Commit: Muir Manders <muir@mnd.rs>

    Improve go-dot-mod-mode font lock regexp
    
    All the go.mod keywords are bounded by the beginning of line and
    whitespace so we use that as our regexp boundaries instead of
    word/symbol boundaries.
    
    Closes: #302 [via git-merge-pr]
---
 go-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index c4be225..afc1e13 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -2635,11 +2635,11 @@ If BUFFER, return the number of characters in that 
buffer instead."
 
 (defconst go-dot-mod-mode-keywords
   '("module" "go" "require" "replace" "exclude")
-  "All keywords in the Go language.  Used for font locking.")
+  "All keywords for go.mod files.  Used for font locking.")
 
 (defvar go-dot-mod-font-lock-keywords
   `(
-    (,(concat "\\_<" (regexp-opt go-dot-mod-mode-keywords t) "\\_>") . 
font-lock-keyword-face))
+    (,(concat "^\\s-*" (regexp-opt go-dot-mod-mode-keywords t) "\\s-") . 
font-lock-keyword-face))
   "Keyword highlighting specification for `go-dot-mod-mode'.")
 
 ;;;###autoload



reply via email to

[Prev in Thread] Current Thread [Next in Thread]