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

    Ensure to restore overlays and mode-line
    
    when pattern becomes smaller that isl-requires-pattern.
---
 isearch-light.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/isearch-light.el b/isearch-light.el
index ccc0b34a6ce..a4811575e1a 100644
--- a/isearch-light.el
+++ b/isearch-light.el
@@ -389,7 +389,9 @@ symbol position."
                        isl-direction-down-string
                      isl-direction-up-string)))
     (setq mode-line-format
-          (cond ((string= isl-pattern "")
+          (cond ((or (string= isl-pattern "")
+                     (<= (length isl-pattern)
+                         isl-requires-pattern))
                  (default-value 'mode-line-format))
                 ((zerop isl--number-results)
                  `(" " mode-line-buffer-identification " "
@@ -443,8 +445,12 @@ appended at end."
     (let ((input (minibuffer-contents)))
       (when (not (string= input isl-pattern))
         (setq isl-pattern input)
-        (when (> (length input) isl-requires-pattern)
-          (isl-update))))))
+        (if (> (length input) isl-requires-pattern)
+            (isl-update)
+          (with-selected-window (minibuffer-selected-window)
+            (isl-delete-overlays)
+            (isl-setup-mode-line)
+            (goto-char isl-initial-pos)))))))
 
 (defun isl-read-from-minibuffer (prompt)
   "Read input from minibuffer with prompt PROMPT."

Reply via email to