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

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

[nongnu] elpa/go-mode fdf46fe 492/495: Fix go.mod fontification.


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode fdf46fe 492/495: Fix go.mod fontification.
Date: Sat, 7 Aug 2021 09:06:16 -0400 (EDT)

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

    Fix go.mod fontification.
    
    Tweak keyword regex so it always allows version after module name.
    Both modules and versions are now fontified properly in:
    
        replace (
          example.com/foo v1.2.3 => example.com/bar v4.5.6
        )
    
    Closes: #377 [via git-merge-pr]
---
 go-mode.el                | 2 +-
 test/go-font-lock-test.el | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index 21719a9..cdd83ac 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -3006,7 +3006,7 @@ If BUFFER, return the number of characters in that buffer 
instead."
 (defvar go-dot-mod-font-lock-keywords
   `(
     (,(concat "^\\s-*\\(" (regexp-opt go-dot-mod-mode-keywords t) "\\)\\s-") 1 
font-lock-keyword-face)
-    
("^\\s-*\\([^[:space:]]+\\)\\s-+\\(v[0-9]+\\.[0-9]+\\.[0-9]+\\)\\([^[:space:]\n]*\\)"
 (1 'go-dot-mod-module-name) (2 'go-dot-mod-module-semver) (3 
'go-dot-mod-module-version)))
+    
("\\(?:^\\|=>\\)\\s-*\\([^[:space:]\n()]+\\)\\(?:\\s-+\\(v[0-9]+\\.[0-9]+\\.[0-9]+\\)\\([^[:space:]\n]*\\)\\)?"
 (1 'go-dot-mod-module-name) (2 'go-dot-mod-module-semver nil t) (3 
'go-dot-mod-module-version nil t)))
   "Keyword highlighting specification for `go-dot-mod-mode'.")
 
 ;;;###autoload
diff --git a/test/go-font-lock-test.el b/test/go-font-lock-test.el
index 7f739c1..e9aef31 100644
--- a/test/go-font-lock-test.el
+++ b/test/go-font-lock-test.el
@@ -210,7 +210,13 @@ KgoK 1.13
 
 KrequireK (
   Nexample.com/require/go/bananaN Sv12.34.56SV-1234-456abcV D// DQindirect
-Q)
+Q      Nnoslash.devN Sv1.2.3S
+)
+
+KreplaceK (
+       Nfoo.example.com/barN Sv1.2.3S => Nfoo.example.com/barN Sv1.2.3S
+       Nexample.com/foo/barN => Nexample.com/baz/barN 
Sv0.0.0SV-20201112005413-933910cbaea0V
+)
 " 'go-dot-mod-mode))
 
 (defun go--should-match-face (want-face)



reply via email to

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