]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/minibuffer.el (minibuffer-completion-help): Fix base-suffix for region.
authorJuri Linkov <juri@linkov.net>
Wed, 15 Nov 2023 17:37:30 +0000 (19:37 +0200)
committerJuri Linkov <juri@linkov.net>
Wed, 15 Nov 2023 17:37:30 +0000 (19:37 +0200)
When used with completion-in-region where completion-in-region-mode-predicate
is non-nil, start base-suffix from point (bug#62700).

lisp/minibuffer.el

index 07a284134d6abaf5081017c458c18d3247233707..9f4ac704599a721fc66b462fb7adeb68b2cdfe96 100644 (file)
@@ -2405,9 +2405,14 @@ These include:
              (base-prefix (buffer-substring (minibuffer--completion-prompt-end)
                                             (+ start base-size)))
              (base-suffix
-              (if (eq (alist-get 'category (cdr md)) 'file)
-                  (buffer-substring (save-excursion (or (search-forward "/" nil t) (point-max)))
-                                    (point-max))
+              (if (or (eq (alist-get 'category (cdr md)) 'file)
+                      completion-in-region-mode-predicate)
+                  (buffer-substring
+                   (save-excursion
+                     (if completion-in-region-mode-predicate
+                         (point)
+                       (or (search-forward "/" nil t) (point-max))))
+                   (point-max))
                 ""))
              (all-md (completion--metadata (buffer-substring-no-properties
                                             start (point))