[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode e0de87c 075/495: do not indent labels in column 0
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode e0de87c 075/495: do not indent labels in column 0 but in normal indentation minus one |
Date: |
Sat, 7 Aug 2021 09:04:46 -0400 (EDT) |
branch: elpa/go-mode
commit e0de87c991d4965260a0845ccff9e44f318f7891
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>
do not indent labels in column 0 but in normal indentation minus one
---
go-mode.el | 8 ++------
indentation_tests/labels.go | 5 +++++
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index 4409d8f..549f547 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -214,12 +214,8 @@ some syntax analysis.")
(if (go-in-string-or-comment-p)
(goto-char point)
(setq indent (go-indentation-at-point))
- (cond
- ((looking-at "case .+:\\|default:")
- (setq indent (- indent tab-width)))
- ((looking-at "[[:word:]]+:\\([[:space:]]*/.+\\)?$")
- (setq indent 0)))
-
+ (if (looking-at "[[:word:]]+:\\([[:space:]]*/.+\\)?$\\|case
.+:\\|default:")
+ (setq indent (- indent tab-width)))
(setq shift-amt (- indent (current-column)))
(if (zerop shift-amt)
nil
diff --git a/indentation_tests/labels.go b/indentation_tests/labels.go
index a954855..3b005bc 100644
--- a/indentation_tests/labels.go
+++ b/indentation_tests/labels.go
@@ -8,4 +8,9 @@ Label2:
code()
Label3: // Comments!
code()
+
+ for {
+ Label4:
+ // code
+ }
}
- [nongnu] elpa/go-mode b1bb0e0 111/495: replace shell-command-on-region with call-process-region, (continued)
- [nongnu] elpa/go-mode b1bb0e0 111/495: replace shell-command-on-region with call-process-region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9f1f94e 113/495: use own implementation of go--string-prefix-p because it has been added in Emacs 24 and people are still using Emacs 23, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 22192f7 121/495: use featurep instead of version string to check for xemacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3b0efdd 132/495: docstrings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7ab928a 146/495: Add support for methods that have no name for the receiver, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 83de700 145/495: Enable compilation-mode for gofmt error buffer before displaying it, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 59f1cb5 140/495: add elisp header, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c693232 137/495: mention flymake-go as an alternative to goflymake, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode ba95288 071/495: load diff-mode on package load, not when running gofmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode bfbbb7e 072/495: remove debug output, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e0de87c 075/495: do not indent labels in column 0 but in normal indentation minus one,
ELPA Syncer <=
- [nongnu] elpa/go-mode 8216ff9 076/495: some nicer lisp, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7d47e3c 079/495: remove old go-propertize-syntax code, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 58640c3 080/495: Do not consider \ an escape character when in raw strings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0c25389 081/495: do not set syntax-propertize-function for emacsen that don't know it (GNU Emacs <24 for one), ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0ecc391 086/495: document issue with go build -o /dev/null, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d7c48cb 089/495: give in and require cl at runtime, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 23310e5 090/495: be more lenient when finding commented imports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2d500b3 091/495: builtins and keywords need to be surrounded by symbols, not word characters, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 71c7f59 101/495: use correct regexps for labels, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3139c0f 107/495: fix regexp-opt usage for emacs <24, ELPA Syncer, 2021/08/07