jedi:goto-definition运行得非常好,但它在我正在编辑的同一个缓冲区中打开定义。对于查找引用,如果它在分割窗格中打开函数的定义,那将更好。将光标保持在原位。
有一种简单的方法吗?
答案 0 :(得分:1)
您可以建议jedi:goto-definition
,以便Emacs在运行jedi:goto-definition
之前拆分帧,然后返回缓冲区。
(defadvice jedi:goto-definition (around definition-in-other-window activate)
"Goto definition in a different window."
(interactive)
;; remove any current frame splits
(delete-other-windows)
;; split the frame vertically
(split-window-right)
;; switch focus to the window on the right
(other-window 1)
ad-do-it
;; switch back to the window on the left
(other-window 1))