emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/helm d2aed1340c 3/3: Merge pull request #2655 from karbiv/


From: ELPA Syncer
Subject: [nongnu] elpa/helm d2aed1340c 3/3: Merge pull request #2655 from karbiv/don't_erase_helm_buf_on_one_char_patterns
Date: Tue, 26 Mar 2024 07:02:27 -0400 (EDT)

branch: elpa/helm
commit d2aed1340c9dcddee776e88efbe2bd0aaf425230
Merge: efa261629e c71956358b
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: GitHub <noreply@github.com>

    Merge pull request #2655 from 
karbiv/don't_erase_helm_buf_on_one_char_patterns
    
    Don't erase helm buffer on some one-char input patterns.
---
 helm-core.el | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/helm-core.el b/helm-core.el
index 3a935ba5aa..7f1de76d83 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -99,9 +99,6 @@ in `helm-initialize'.")
   "The value of point at selection.")
 (defvar helm-alive-p nil)
 (defvar helm-visible-mark-overlays nil)
-(defvar helm-update-blacklist-regexps '("^" "^ *" "$" "!" " " "\\b"
-                                        "\\<" "\\>" "\\_<" "\\_>" ".*"
-                                        "??" "?*" "*?" "?"))
 (defvar helm--force-updating-p nil
   "[INTERNAL] Don't use this in your programs.")
 (defvar helm-exit-status 0
@@ -5075,7 +5072,9 @@ without recomputing them, it should be a list of lists."
           ;; when next chunk of update will arrive,
           ;; otherwise the buffer is erased AFTER [1] the results
           ;; are computed.
-          (unless sources (erase-buffer))
+          ;; FIXME the explanation above is probably obsolete.
+          ;;(unless sources (erase-buffer))
+          
           ;; Compute matches without rendering the sources.
           ;; This prevent the helm-buffer flickering when constantly
           ;; updating.
@@ -5084,7 +5083,7 @@ without recomputing them, it should be a list of lists."
           ;; If computing matches finished and is not interrupted
           ;; erase the helm-buffer and render results (Fix #1157).
           (when matches ;; nil only when interrupted by while-no-input.
-            (erase-buffer)             ; [1]
+            (erase-buffer)
             (cl-loop for src in sources
                      for mtc in matches
                      do (helm-render-source src mtc))
@@ -5121,16 +5120,13 @@ without recomputing them, it should be a list of lists."
              (member (assoc-default 'name source) helm-source-filter))
          (>= len
              (helm-aif (assq 'requires-pattern source) (or (cdr it) 1) 0))
-         ;; Entering repeatedly these strings (*, ?) takes 100% CPU
-         ;; and hang emacs on MacOs preventing deleting backward those
-         ;; characters (Bug#1802). Update: it seems it is no more true,
-         ;; thus this affect bug#2423, so let's remove this for now.
-         ;; (not (string-match-p "\\`[*]+\\'" helm-pattern))
-         ;; These incomplete regexps hang helm forever
-         ;; so defer update. Maybe replace spaces quoted when using
-         ;; multi-match.
-         (not (member (replace-regexp-in-string "\\s\\ " " " helm-pattern)
-                      helm-update-blacklist-regexps)))))
+         ;; bugs were mentioned here before: Bug#1802, bug#2423
+         ;; must be fixed already by 'helm-re-search-forward'
+         ;;
+         ;; short patterns that are alone not expected to return any results,
+         ;; ignore in order to not erase Helm buffer on such patterns.
+         (cl-loop for p in (helm-mm-split-pattern helm-pattern)
+                  never (member p '("!" "!^" "?" "@!"))))))
 
 (defun helm--update-move-first-line ()
   "Goto first line of `helm-buffer'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]