[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode eddbcff 277/495: Make sure we're looking at func k
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode eddbcff 277/495: Make sure we're looking at func keyword |
Date: |
Sat, 7 Aug 2021 09:05:31 -0400 (EDT) |
branch: elpa/go-mode
commit eddbcff822e6f9938bbe669d966f32ab5c7a36e8
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>
Make sure we're looking at func keyword
---
go-mode.el | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index 11c5c68..81426b2 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1591,16 +1591,16 @@ If ARG is non-nil, anonymous functions are ignored."
(while (looking-at "^//")
(forward-line 1))
;; If we are still not looking at a function, retry by calling self
again.
- (when (not (looking-at "func"))
+ (when (not (looking-at "\\<func\\>"))
(go-goto-function arg)))
;; If we're already looking at an anonymous func, look for the
;; surrounding function.
- ((and (looking-at "func")
- (not (looking-at "^func")))
+ ((and (looking-at "\\<func\\>")
+ (not (looking-at "^func\\>")))
(re-search-backward "\\<func\\>" nil t))
- ((not (looking-at "func"))
+ ((not (looking-at "\\<func\\>"))
;; If point is on the "func" keyword, step back a word and retry
(if (string= (symbol-name (symbol-at-point)) "func")
(backward-word)
@@ -1610,7 +1610,7 @@ If ARG is non-nil, anonymous functions are ignored."
;; If nothing is found, assume that we are at the top of the file and
;; should search forward instead.
- (when (not (looking-at "func"))
+ (when (not (looking-at "\\<func\\>"))
(re-search-forward "\\<func\\>" nil t)
(forward-word -1))
@@ -1618,7 +1618,7 @@ If ARG is non-nil, anonymous functions are ignored."
;; were not inside it but below it. If we were not inside it, we should
;; go to the containing function.
(while (and (not (go--in-function-p p))
- (not (looking-at "^func")))
+ (not (looking-at "^func\\>")))
(go-goto-function arg)))))
(cond
@@ -1626,7 +1626,7 @@ If ARG is non-nil, anonymous functions are ignored."
;; If we are still in a comment, redo the call so that we get out of it.
(go-goto-function arg))
- ((and (looking-at "func(") arg)
+ ((and (looking-at "\\<func(") arg)
;; If we are looking at an anonymous function and a prefix argument has
;; been supplied, redo the call so that we skip the anonymous function.
(go-goto-function arg))))
@@ -1645,7 +1645,7 @@ If ARG is non-nil, anonymous functions are ignored."
(defun go--in-function-p (compare-point)
"Return t if COMPARE-POINT lies inside the function immediately surrounding
point."
(save-excursion
- (when (not (looking-at "func"))
+ (when (not (looking-at "\\<func\\>"))
(go-goto-function))
(let ((start (point)))
(go--goto-opening-curly-brace)
@@ -1664,14 +1664,14 @@ If the function is anonymous, place point on the 'func'
keyword.
If one prefix argument is given, anonymous functions are skipped."
(interactive "P")
- (when (not (looking-at "func"))
+ (when (not (looking-at "\\<func\\>"))
(go-goto-function arg))
;; If we are looking at func( we are on an anonymous function and
;; nothing else should be done.
- (when (not (looking-at "func("))
+ (when (not (looking-at "\\<func("))
(let ((words 1)
(chars 1))
- (when (looking-at "func (")
+ (when (looking-at "\\<func (")
(setq words 3
chars 2))
(forward-word words)
@@ -1792,7 +1792,7 @@ Returns nil otherwise."
"Return t if point is inside an anonymous function, nil otherwise."
(save-excursion
(go-goto-function)
- (looking-at "func(")))
+ (looking-at "\\<func(")))
(define-prefix-command 'go-goto-map)
(define-key go-mode-map (kbd "C-c C-g") 'go-goto-map)
- [nongnu] elpa/go-mode 86ed568 235/495: add link to `defgroup'., (continued)
- [nongnu] elpa/go-mode 86ed568 235/495: add link to `defgroup'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a9b9871 247/495: Use view-mode in godoc-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dce210f 250/495: Bump version to 1.3.1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8baa836 251/495: Don't break fontification when limiting point, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dccb56c 256/495: go-unused-imports-lines: only compile the current file, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d91a157 257/495: Add goto functions for working with function signatures, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 11e7b4e 259/495: Fix copy-pasted docstring of go-goto-arguments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b261fac 263/495: Add support for (nested) anonymous functions in go-goto-function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6e8373e 267/495: go-goto-docstring: handle empty comments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d1ebde8 271/495: Rename go--get-function-name to go--function-name, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode eddbcff 277/495: Make sure we're looking at func keyword,
ELPA Syncer <=
- [nongnu] elpa/go-mode 45a8131 284/495: Implement go--goto-opening-curly-brace as in go-end-of-defun, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d6aa01a 287/495: Merge branch 'movement', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 27b7415 293/495: Allow passing additional arguments to gofmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 1214f77 294/495: Bind go-goto-map to C-f, not C-g, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 17bd2b2 296/495: Add GOPATH detection, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9f785cc 298/495: Document stability of the master branch, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f8b4bf9 300/495: Add to beginning of compilation-error-regexp-alist, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode cfaa193 348/495: cmd/guru: rename oracle to guru, copying it to a single package, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4d1ab9f 347/495: cmd/oracle: improve error messages, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9c2bf9b 360/495: cmd/guru: emacs: push mark in go-guru-definition, ELPA Syncer, 2021/08/07