branch: elpa/go-mode
commit 1fcf76d47e33c78aa58e7470f443ac438b753a83
Author: Muir Manders <[email protected]>
Commit: Peter Sanford <[email protected]>
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),