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

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

[nongnu] elpa/go-mode 1fcf76d 435/495: Fix indentation regexes to be cas


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 1fcf76d 435/495: Fix indentation regexes to be case insensitive
Date: Sat, 7 Aug 2021 09:06:03 -0400 (EDT)

branch: elpa/go-mode
commit 1fcf76d47e33c78aa58e7470f443ac438b753a83
Author: Muir Manders <muir@retailnext.net>
Commit: Peter Sanford <psanford@sanford.io>

    Fix indentation regexes to be case insensitive
    
    We don't want to match things like CASE DEFAULT:.
    
    Closes: #285 [via git-merge-pr]
---
 go-mode.el                                          | 2 ++
 test/testdata/indentation_tests/multiline_struct.go | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index ca9bd0a..e0f95e2 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -768,6 +768,8 @@ The return value is the position of the opening paren."
   (interactive)
   (let (indent
         shift-amt
+        ;; case sensitively match "case", "default", etc.
+        (case-fold-search nil)
         (pos (- (point-max) (point)))
         (point (point))
         (beg (line-beginning-position)))
diff --git a/test/testdata/indentation_tests/multiline_struct.go 
b/test/testdata/indentation_tests/multiline_struct.go
index 26a5f6f..87eb884 100644
--- a/test/testdata/indentation_tests/multiline_struct.go
+++ b/test/testdata/indentation_tests/multiline_struct.go
@@ -5,8 +5,10 @@ func _() {
 
        foo := Bar{
                {
-                       Index: int(index),
-                       MTU:   int(row.Mtu),
+                       Index:   int(index),
+                       MTU:     int(row.Mtu),
+                       DEFAULT: 123,
+                       CASE:    123,
                },
                {
                        Index: int(index),



reply via email to

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