[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode fa2162b 475/495: Fix "nil" fontification in type s
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode fa2162b 475/495: Fix "nil" fontification in type switch clause. |
Date: |
Sat, 7 Aug 2021 09:06:12 -0400 (EDT) |
branch: elpa/go-mode
commit fa2162b6b34af0d2e8038940d8fa13e775a1cae6
Author: Muir Manders <muir@mnd.rs>
Commit: Peter Sanford <psanford@sanford.io>
Fix "nil" fontification in type switch clause.
Be sure to fontify "nil" as a constant instead of a type name.
Closes: #326 [via git-merge-pr]
---
go-mode.el | 3 ++-
test/go-font-lock-test.el | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/go-mode.el b/go-mode.el
index f567830..ac71cb6 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1422,7 +1422,8 @@ comma, it stops at it. Return non-nil if comma was found."
(while (and (not found-match) (not done))
(when (looking-at (concat "[[:space:]\n]*" go-type-name-regexp
"[[:space:]]*[,:]"))
(goto-char (match-end 1))
- (setq found-match t))
+ (unless (member (match-string 1) go-constants)
+ (setq found-match t)))
(setq done (not (go--search-next-comma end))))
found-match))
diff --git a/test/go-font-lock-test.el b/test/go-font-lock-test.el
index 2b858ea..6a8306f 100644
--- a/test/go-font-lock-test.el
+++ b/test/go-font-lock-test.el
@@ -76,6 +76,8 @@ KmapK[TstringT]KinterfaceK{}{
(go--should-fontify "
KswitchK foo.(KtypeK) {
KcaseK TstringT, *Tfoo.ZebraT, [2]TbyteT:
+KcaseK CnilC:
+KdefaultK:
}")
(go--should-fontify "
- [nongnu] elpa/go-mode a13b814 448/495: Add option to reuse a single buffer for godoc, (continued)
- [nongnu] elpa/go-mode a13b814 448/495: Add option to reuse a single buffer for godoc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a82369b 453/495: Readme: add basic information about gopls., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 839190b 455/495: Run all tests in GH CI, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7248358 462/495: Fontify type names in type switch statements, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4fabba6 464/495: Small fix for fontification of array types, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 656590a 463/495: Fontify qualified composite literal types., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d304565 474/495: Fix signature fontification after comments., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e9b9c0e 473/495: Add some fontification faces for go-dot-mod-mode., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4acf733 468/495: Fully fontify type and const decls., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dac200f 469/495: Fix font locking in nested signatures., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fa2162b 475/495: Fix "nil" fontification in type switch clause.,
ELPA Syncer <=
- [nongnu] elpa/go-mode 7ce031c 481/495: Allow disabling variable font locking., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e10d677 478/495: indent: fix func literals in dangling lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c9f5e92 483/495: Fix indentation of chained dangling selectors., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fdf46fe 492/495: Fix go.mod fontification., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e8eea7f 487/495: Fix fontification of multiline type switch clauses., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2f2910c 223/495: fix end-of-defun for function with inline struct/interface arguments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f1adac0 230/495: switch versioning to semver, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d9f0bee 232/495: add variable to customize godef command, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3da268f 285/495: README: improve description of new functions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9047fcd 238/495: add a menu, ELPA Syncer, 2021/08/07