[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 2f302d2 279/495: Update go--goto-opening-curly-bra
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 2f302d2 279/495: Update go--goto-opening-curly-brace to handle more cases |
Date: |
Sat, 7 Aug 2021 09:05:31 -0400 (EDT) |
branch: elpa/go-mode
commit 2f302d236f120f0a1a2ae8cf0c300dc6cd97cb10
Author: Lowe Thiderman <lowe.thiderman@gmail.com>
Commit: Dominik Honnef <dominik@honnef.co>
Update go--goto-opening-curly-brace to handle more cases
Add handling of anonymous interfaces.
By chance, also handle the case of a dotted return value like "a.B".
---
go-mode.el | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index b44273a..9642fc3 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1636,11 +1636,23 @@ If ARG is non-nil, anonymous functions are ignored."
;; Try to place the point on the opening brace.
(cond
((looking-at "(")
+ ;; Multiple return values! Just walk past the list and we're done!
(forward-list 1)
(forward-char 1))
+
((not (looking-at "{"))
- (forward-word 1)
- (forward-char 1))))
+ ;; Place point at the next curly brace.
+ (search-forward "{")
+ (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)))))
(defun go--in-function-p (compare-point)
"Return t if COMPARE-POINT lies inside the function immediately surrounding
point."
- [nongnu] elpa/go-mode 15d227a 253/495: gofmt: wrap external commands in `unwind-protect', (continued)
- [nongnu] elpa/go-mode 15d227a 253/495: gofmt: wrap external commands in `unwind-protect', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 91c4496 254/495: go-unused-imports-lines escape dot in regexp correctly, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0b1ec30 255/495: go-unused-imports-lines pass -e to compiler to get all errors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 46448ea 258/495: Collect all the define-key statements at the bottom, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8965fa1 261/495: Use forward-list instead of re-search-forward in go-goto-return-value, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 10f7d10 260/495: go-goto-return-value: don't move past pointer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b78582a 262/495: Rename go-goto-type-signature to go-goto-method-receiver, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a16e2e0 266/495: Update docstring and comments for go--in-function-p, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 94ffc7a 270/495: go-goto-docstring: insert function name even if empty comment, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 093a492 274/495: Rename go--in-function-p to go--below-anonymous-function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2f302d2 279/495: Update go--goto-opening-curly-brace to handle more cases,
ELPA Syncer <=
- [nongnu] elpa/go-mode 29f3380 280/495: Remove trailing whitespace in go-mode.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dd46d4f 281/495: Modify go--goto-opening-curly-brace to use end-of-defun, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6fc1f35 282/495: Move go-goto keymap to the rest of the keymap, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 400d2ae 289/495: Add a changelog, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0f9b5c5 291/495: Add go-packages-function and go-packages-go-list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8c884f3 292/495: Support goimports' new -srcdir flag, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c65dd39 297/495: Complain about outdated goimports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0b5b29d 316/495: Reformat code, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a6717a1 318/495: Fix filename replacement in gofmt error buffer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 50bceae 326/495: Use HTTPS with go-play-region, ELPA Syncer, 2021/08/07