summaryrefslogtreecommitdiff
path: root/cider-overlays.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-07-30 01:12:48 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-07-30 01:12:48 +0100
commitbf774a7b7e9b7155c57e7a07bbbd5c3c87024a81 (patch)
tree581fb24965a04149afbcccaa244a72253b1f9da5 /cider-overlays.el
parent4900f9336a4aa7935ed93b080f2e5cb8122baad8 (diff)
Display result in the echo if the edge of the overlay is off the screen
Diffstat (limited to 'cider-overlays.el')
-rw-r--r--cider-overlays.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/cider-overlays.el b/cider-overlays.el
index ce71030a..e4e249e3 100644
--- a/cider-overlays.el
+++ b/cider-overlays.el
@@ -127,7 +127,13 @@ PROPS are passed to `cider--make-overlay' with a type of result."
((pred numberp) (run-at-time duration nil #'cider--delete-overlay o))
(`command (add-hook 'post-command-hook #'cider--remove-result-overlay nil 'local)))
(-when-let (win (get-buffer-window buffer))
- (when (pos-visible-in-window-p (point) win)
+ ;; Left edge is visible.
+ (when (and (pos-visible-in-window-p (point) win)
+ ;; Right edge is visible. This is a little conservative
+ ;; if the overlay contains line breaks.
+ (or (< (+ (current-column) (string-width value))
+ (window-width win))
+ (not truncate-lines)))
o)))))
nil))