From 579ea5f6e2475b880737ba157a6629ab92c1138c Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 15 Nov 2023 19:37:30 +0200 Subject: [PATCH] * lisp/minibuffer.el (minibuffer-completion-help): Fix base-suffix for region. 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 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 07a284134d6..9f4ac704599 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -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)) -- 2.39.2