summaryrefslogtreecommitdiff
path: root/cider-stacktrace.el
diff options
context:
space:
mode:
authorMichael Griffiths <mikey@cich.li>2015-03-15 12:34:22 +0000
committerMichael Griffiths <mikey@cich.li>2015-03-15 21:06:17 +0000
commitda652f73136c8dbf5d3e0dc95ae497baabeaf3c7 (patch)
tree1b263194c5a08b309b7410ac97613d8dbda5488f /cider-stacktrace.el
parent5124c2bd4c55e90808f3810db50752281c91350d (diff)
Ensure point is moved correctly when rendering stacktrace
Diffstat (limited to 'cider-stacktrace.el')
-rw-r--r--cider-stacktrace.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/cider-stacktrace.el b/cider-stacktrace.el
index f7acb875..9e8df44c 100644
--- a/cider-stacktrace.el
+++ b/cider-stacktrace.el
@@ -521,10 +521,15 @@ This associates text properties to enable filtering and source navigation."
(cider-stacktrace-cycle-cause (length causes) 1)))
;; Fully display innermost cause. This also applies visibility/filters.
(cider-stacktrace-cycle-cause 1 cider-stacktrace-detail-max)
- ;; Move point to first stacktrace frame in displayed cause.
- (goto-char (point-min))
- (while (cider-stacktrace-next-cause))
- (goto-char (next-single-property-change (point) 'flags)))
+ ;; Move point to first stacktrace frame in displayed cause. If the error
+ ;; buffer is visible in a window, ensure that window is selected while moving
+ ;; point, so as to move both the buffer's and the window's point.
+ (with-selected-window (or (get-buffer-window cider-error-buffer)
+ (selected-window))
+ (with-current-buffer cider-error-buffer
+ (goto-char (point-min))
+ (while (cider-stacktrace-next-cause))
+ (goto-char (next-single-property-change (point) 'flags)))))
(defun cider-stacktrace-render (buffer causes)
"Emit into BUFFER useful stacktrace information for the CAUSES."