branch: elpa/isl
commit 5a1322e1a11687c09a7a3782aa50e1b7ac0f32e1
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Fix error when quitting with empty pattern
    
    In this case there is no overlays.
---
 isearch-light.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/isearch-light.el b/isearch-light.el
index f1e40c043f1..da06f8a846a 100644
--- a/isearch-light.el
+++ b/isearch-light.el
@@ -513,8 +513,9 @@ appended at end."
 
 (defun isl-cleanup ()
   "Cleanup various things when `isl' exit."
-  (let* ((pos (overlay-end isl--last-overlay))
-         (hs-show-hook (list (lambda () (goto-char pos)))))
+  (let* ((pos (and isl--last-overlay ; nil when quitting with no results.
+                   (overlay-end isl--last-overlay)))
+         (hs-show-hook (list (lambda () (and pos (goto-char pos))))))
     (isl-delete-overlays)
     (setq mode-line-format (default-value 'mode-line-format)
           isl--yank-point nil

Reply via email to