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

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

[nongnu] elpa/go-mode 72cf126 056/495: fix indentation for multi-line if


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 72cf126 056/495: fix indentation for multi-line if expressions
Date: Sat, 7 Aug 2021 09:04:43 -0400 (EDT)

branch: elpa/go-mode
commit 72cf1263e0ba863e7f434d10378a1b4dec2bb9fa
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>

    fix indentation for multi-line if expressions
    
    This fixes a regression introduced by
    95c9519fb9e010df8e9aa91d5925a84a1f97d424
---
 go-mode.el                        | 2 ++
 indentation_tests/multiline_if.go | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/go-mode.el b/go-mode.el
index 14410e6..de34f3e 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -193,6 +193,8 @@ built-ins, functions, and some types.")
               (if (< (go-paren-level) start-nesting)
                   (if (go-previous-line-has-opening-parenthesis-p)
                       (current-indentation)
+                    (if (go-previous-line-has-dangling-op-p)
+                        (setq outindent tab-width))
                     (+ (current-indentation) tab-width (- outindent)))
                 (- (current-indentation) outindent)))))))))
 
diff --git a/indentation_tests/multiline_if.go 
b/indentation_tests/multiline_if.go
new file mode 100644
index 0000000..410704d
--- /dev/null
+++ b/indentation_tests/multiline_if.go
@@ -0,0 +1,5 @@
+if realLength == -1 &&
+       !chunked(t.TransferEncoding) &&
+       bodyAllowedForStatus(t.StatusCode) {
+       t.Close = true
+}



reply via email to

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