From a4c60706e2e93a720625ae3e16ef20809837d581 Mon Sep 17 00:00:00 2001 From: cxxxr Date: Sat, 30 Sep 2023 11:21:56 +0900 Subject: [PATCH] fix :noh behavior --- src/ext/isearch.lisp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ext/isearch.lisp b/src/ext/isearch.lisp index 9f210a6ac..f914137f3 100644 --- a/src/ext/isearch.lisp +++ b/src/ext/isearch.lisp @@ -312,13 +312,14 @@ (isearch-add-char char))) (defun isearch-end () - (isearch-reset-overlays (current-buffer)) - (change-previous-string *isearch-string*) - (buffer-unbound (current-buffer) 'isearch-redisplay-string) - (remove-hook (variable-value 'after-change-functions :buffer) - 'isearch-change-buffer-hook) - (isearch-mode nil) - t) + (when (boundp '*isearch-string) + (isearch-reset-overlays (current-buffer)) + (change-previous-string *isearch-string*) + (buffer-unbound (current-buffer) 'isearch-redisplay-string) + (remove-hook (variable-value 'after-change-functions :buffer) + 'isearch-change-buffer-hook) + (isearch-mode nil) + t)) (defun isearch-redisplay-inactive (buffer) (alexandria:when-let ((string (buffer-value buffer 'isearch-redisplay-string)))