Skip to content

Commit 3a5b495

Browse files
committed
Two small robustness tweaks
Truncate huge eval results before the overlay face bookkeeping walks them (they get cut to the display threshold anyway), and give the reload-clear sync request a 60s timeout - the op is fast by itself but serializes behind any refresh already in flight (#3652).
1 parent 2fca572 commit 3a5b495

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

lisp/cider-ns.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,11 @@ inhibit-fns)), which is how `cider-ns-menu' passes its arguments."
383383
nil
384384
t))
385385
(when clear?
386-
(cider-nrepl-sync-request `("op" ,(cider-ns--reload-op "reload-clear")) :connection conn))
386+
;; The clear op is fast by itself, but it serializes behind any
387+
;; refresh already in flight, which on large projects can hold
388+
;; the lock well past the default timeout (#3652).
389+
(let ((nrepl-sync-request-timeout 60))
390+
(cider-nrepl-sync-request `("op" ,(cider-ns--reload-op "reload-clear")) :connection conn)))
387391
(let ((reloading (list nil)))
388392
(cider-nrepl-send-request
389393
`("op" ,(cider-ns--reload-op (if all? "reload-all" "reload"))

lisp/cider-overlays.el

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,12 @@ overlay."
328328
;; Maximum value width at which we truncate it.
329329
(truncation-threshold (* 3 (window-width)))
330330
(o nil))
331+
;; Huge results get truncated to the threshold below anyway; cut
332+
;; them down early so the face and width bookkeeping doesn't have
333+
;; to walk the full text.
334+
(when (> (length display-string) (* 2 truncation-threshold))
335+
(setq display-string
336+
(substring display-string 0 (* 2 truncation-threshold))))
331337
;; Remove any overlay at the position we're creating a new one, if it
332338
;; exists.
333339
(remove-overlays beg end 'category type)

0 commit comments

Comments
 (0)