summaryrefslogtreecommitdiff
path: root/cider-common.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2016-04-16 15:55:02 -0300
committerArtur Malabarba <bruce.connor.am@gmail.com>2016-04-16 15:55:02 -0300
commit21f4caafd9ae7963c4439b1ad1e0e66c1469715e (patch)
tree4a81bc2f28055322a3769bb55cd28207368959c7 /cider-common.el
parent79941e969283ed684a4ce009bfcf766a1371c54f (diff)
Fix enlighten-mode accidentally moving point
Diffstat (limited to 'cider-common.el')
-rw-r--r--cider-common.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/cider-common.el b/cider-common.el
index dacc7c4e..cb3b7c8a 100644
--- a/cider-common.el
+++ b/cider-common.el
@@ -79,6 +79,15 @@ On failure, read a symbol name using PROMPT and call CALLBACK with that."
(declare-function cider-jump-to "cider-interaction")
+(defun cider--find-buffer-for-file (file)
+ "Return a buffer visiting FILE.
+If FILE is a temp buffer name, return that buffer."
+ (if (string-prefix-p "*" file)
+ file
+ (and file
+ (not (cider--tooling-file-p file))
+ (cider-find-file file))))
+
(defun cider--jump-to-loc-from-info (info &optional other-window)
"Jump to location give by INFO.
INFO object is returned by `cider-var-info' or `cider-member-info'.
@@ -87,11 +96,7 @@ OTHER-WINDOW is passed to `cider-jump-to'."
(file (nrepl-dict-get info "file"))
(name (nrepl-dict-get info "name"))
;; the filename might actually be a REPL buffer name
- (buffer (if (string-prefix-p "*" file)
- file
- (and file
- (not (cider--tooling-file-p file))
- (cider-find-file file)))))
+ (buffer (cider--find-buffer-for-file file)))
(if buffer
(cider-jump-to buffer (if line (cons line nil) name) other-window)
(error "No source location"))))