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

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

[nongnu] elpa/go-mode 52914d5 039/495: Correctly indent next line if raw


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 52914d5 039/495: Correctly indent next line if raw string is following an operator
Date: Sat, 7 Aug 2021 09:04:39 -0400 (EDT)

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

    Correctly indent next line if raw string is following an operator
    
    Closes gh-10
---
 go-mode.el                 | 5 +++--
 indentation_tests/gh-10.go | 6 ++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index a3a52b8..6cacedf 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -125,8 +125,9 @@ built-ins, functions, and some types.")
 (defun go--backward-irrelevant ()
   (let (pos (start-pos (point)))
     (skip-chars-backward "\n[:blank:]")
-    (if (looking-back "`")
-        (backward-char))
+    (if (save-excursion (beginning-of-line) (go-in-string-p))
+        (if (looking-back "`")
+            (backward-char)))
     (if (go-in-string-p)
         (go-goto-beginning-of-string-or-comment))
     (if (looking-back "\\*/")
diff --git a/indentation_tests/gh-10.go b/indentation_tests/gh-10.go
new file mode 100644
index 0000000..93bdff2
--- /dev/null
+++ b/indentation_tests/gh-10.go
@@ -0,0 +1,6 @@
+package gh10
+
+func foo() string {
+       s := `foo`
+       return s
+}



reply via email to

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