[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 3f02a16 406/495: Add go-guru-definition-other-wind
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 3f02a16 406/495: Add go-guru-definition-other-window |
Date: |
Sat, 7 Aug 2021 09:05:57 -0400 (EDT) |
branch: elpa/go-mode
commit 3f02a165dba38295ae4b961482fe50e012a2112a
Author: Jeff Hodges <jeff@somethingsimilar.com>
Commit: Dominik Honnef <dominik@honnef.co>
Add go-guru-definition-other-window
Adds go-guru-definition-other-window that opens the defintion of the
target in another window. Equivalent to godef-jump-other-window.
Fixes #175
---
go-guru.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/go-guru.el b/go-guru.el
index c2ac658..ca83cbc 100644
--- a/go-guru.el
+++ b/go-guru.el
@@ -319,11 +319,11 @@ If BUFFER, return the number of characters in that buffer
instead."
"Go to the OFFSETth byte in the current line."
(goto-char (byte-to-position (+ (position-bytes (point-at-bol)) (1-
offset)))))
-(defun go-guru--goto-pos (posn)
+(defun go-guru--goto-pos (posn other-window)
"Find the file containing the position POSN (of the form `file:line:col')
set the point to it, switching the current buffer."
(let ((file-line-pos (split-string posn ":")))
- (find-file (car file-line-pos))
+ (funcall (if other-window #'find-file-other-window #'find-file) (car
file-line-pos))
(goto-char (point-min))
(forward-line (1- (string-to-number (cadr file-line-pos))))
(go-guru--goto-byte-column (string-to-number (cl-caddr file-line-pos)))))
@@ -359,7 +359,7 @@ function containing the current point."
(go-guru--start "callstack"))
;;;###autoload
-(defun go-guru-definition ()
+(defun go-guru-definition (&optional other-window)
"Jump to the definition of the selected identifier."
(interactive)
(or buffer-file-name
@@ -371,10 +371,16 @@ function containing the current point."
;; TODO: Integrate this facility with XRef.
(xref-push-marker-stack)
(ring-insert find-tag-marker-ring (point-marker)))
- (go-guru--goto-pos (cdr (assoc 'objpos res)))
+ (go-guru--goto-pos (cdr (assoc 'objpos res)) other-window)
(message "%s" desc)))
;;;###autoload
+(defun go-guru-definition-other-window ()
+ "Jump to the defintion of the selected identifier in another window"
+ (interactive)
+ (go-guru-definition t))
+
+;;;###autoload
(defun go-guru-describe ()
"Describe the selected syntax, its kind, type and methods."
(interactive)
- [nongnu] elpa/go-mode 4146860 373/495: cmd/guru: Emacs: run guru asynchronously using compilation-mode, (continued)
- [nongnu] elpa/go-mode 4146860 373/495: cmd/guru: Emacs: run guru asynchronously using compilation-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7077c4f 375/495: cmd/guru: fix quoting bug in Emacs binding, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 142eae4 374/495: cmd/guru: add menu to Emacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode eb8cf16 386/495: refactor/rename: emacs: package.el compatibility changes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode bfc4f9b 385/495: tools/refactor/rename: add provide to rename.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0604054 388/495: cmd/gorename: emacs: do not auto shrink error window, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 1b85887 389/495: refactor/rename: require cl-lib, use cl- namespace, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8144ae8 392/495: Merge commit '12ef34c', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 269eb01 398/495: Remove support for Emacs 23, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 5056b85 403/495: Use xref functions if available, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3f02a16 406/495: Add go-guru-definition-other-window,
ELPA Syncer <=
- [nongnu] elpa/go-mode 7eb5b3d 409/495: Delete go-mode-autoloads.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2d1d33a 407/495: Fix off-by-one in point calculations, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7f87c32 416/495: Permit empty guru scope, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode be9186c 417/495: Support remote files in `gofmt', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 287595a 420/495: Don't traverse symlinks when recursing directories, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b990645 425/495: Fix call expr indenting after dangling operator., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode ac6dd8c 430/495: Fix go-remove-unused-imports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e8674fe 437/495: Expand electric indent config a bit, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6a64cbf 439/495: Fix indentation for composite literal keys., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fb1272c 441/495: indent: fix performance in giant comments, ELPA Syncer, 2021/08/07