Skip to content

Commit 09dc596

Browse files
author
dan sutton
committed
Catch quit signal and remove overlays
Previously could easily leave the buffer overlay on top quite easily. Seems especially bad in ivy, which most probably means ivy is doing it correctly.
1 parent dcbbd30 commit 09dc596

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

resize-window.el

+19-17
Original file line numberDiff line numberDiff line change
@@ -227,23 +227,25 @@ to enlarge right."
227227
(interactive)
228228
(setq resize-window--background-overlay (resize-window--make-background))
229229
(resize-window--notify "Resize mode: enter character, ? for help")
230-
(let ((reading-characters t)
231-
;; allow mini-buffer to collapse after displaying menu
232-
(resize-mini-windows t))
233-
(while reading-characters
234-
(let* ((char (resize-window--match-alias (read-key)))
235-
(choice (assoc char resize-window-dispatch-alist))
236-
(capital (when (numberp char)
237-
(assoc (+ char 32) resize-window-dispatch-alist))))
238-
(cond
239-
(choice (resize-window--execute-action choice))
240-
((and capital (resize-window--allows-capitals capital))
241-
;; rather than pass an argument, we tell it to "scale" it
242-
;; with t and that method can worry about how to get that
243-
;; action
244-
(resize-window--execute-action capital t))
245-
(t (setq reading-characters nil)
246-
(delete-overlay resize-window--background-overlay)))))))
230+
(condition-case nil
231+
(let ((reading-characters t)
232+
;; allow mini-buffer to collapse after displaying menu
233+
(resize-mini-windows t))
234+
(while reading-characters
235+
(let* ((char (resize-window--match-alias (read-key)))
236+
(choice (assoc char resize-window-dispatch-alist))
237+
(capital (when (numberp char)
238+
(assoc (+ char 32) resize-window-dispatch-alist))))
239+
(cond
240+
(choice (resize-window--execute-action choice))
241+
((and capital (resize-window--allows-capitals capital))
242+
;; rather than pass an argument, we tell it to "scale" it
243+
;; with t and that method can worry about how to get that
244+
;; action
245+
(resize-window--execute-action capital t))
246+
(t (setq reading-characters nil)
247+
(delete-overlay resize-window--background-overlay))))))
248+
(quit (resize-window--delete-overlays))))
247249

248250
;;; Function Handlers
249251
(defun resize-window--enlarge-down (&optional size)

0 commit comments

Comments
 (0)