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

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

[nongnu] elpa/go-mode dd46d4f 281/495: Modify go--goto-opening-curly-bra


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode dd46d4f 281/495: Modify go--goto-opening-curly-brace to use end-of-defun
Date: Sat, 7 Aug 2021 09:05:31 -0400 (EDT)

branch: elpa/go-mode
commit dd46d4f1fc4d1fa5aaa05702b37a7487cfc00240
Author: Lowe Thiderman <lowe.thiderman@gmail.com>
Commit: Dominik Honnef <dominik@honnef.co>

    Modify go--goto-opening-curly-brace to use end-of-defun
---
 go-mode.el | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index a7b68c0..5c06ebb 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1641,18 +1641,10 @@ If ARG is non-nil, anonymous functions are ignored."
     (forward-char 1))
 
    ((not (looking-at "{"))
-    ;; Place point at the next curly brace.
-    (search-forward "{")
+    ;; Go to the end of the defun and back up and we'll be where we want to be.
+    (end-of-defun)
     (backward-char 1)
-    ;; Check of the end of the other parenthesis looks like "} {". If it does,
-    ;; we are looking at the definition of an anonymous intefrace return value.
-    ;; Move past the list and one char forward and we are done.
-    (when (save-excursion
-            (forward-list 1)
-            (backward-char 1)
-            (looking-at "} {"))
-      (forward-list 1)
-      (forward-char 1)))))
+    (backward-list 1))))
 
 (defun go--in-function-p (compare-point)
   "Return t if COMPARE-POINT lies inside the function immediately surrounding 
point."



reply via email to

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