[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/minibuffer-header 1d2cc29e4e 1/2: Better prompt detecti
From: |
ELPA Syncer |
Subject: |
[elpa] externals/minibuffer-header 1d2cc29e4e 1/2: Better prompt detection |
Date: |
Mon, 8 Aug 2022 06:57:43 -0400 (EDT) |
branch: externals/minibuffer-header
commit 1d2cc29e4e078e43a3a7e5f92158f0e2753ff9b9
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Better prompt detection
---
minibuffer-header.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/minibuffer-header.el b/minibuffer-header.el
index 87cc619e2c..33e550c076 100644
--- a/minibuffer-header.el
+++ b/minibuffer-header.el
@@ -113,8 +113,13 @@
(goto-char (point-min))
(let* ((inhibit-read-only t)
(prompt-beg (point-min))
- (prompt-end (or (next-property-change (+ 1 (point-min)))
- (max (point-min) (- (point-max) 0))))
+ (prompt-end nil)
+ (prompt-end (or prompt-end
+ (save-excursion (search-forward-regexp ":[ \t]*"
nil t))))
+ (prompt-end (or prompt-end
+ (next-property-change (+ 1 (point-min)))))
+ (prompt-end (or prompt-end
+ (point-max)))
(prompt (buffer-substring-no-properties prompt-beg prompt-end))
(left (if (stringp 'minibuffer-header-format)
minibuffer-header-format
@@ -122,8 +127,7 @@
(left (split-string left "\n"))
(width (- (window-width) (length (car left)) 2))
(right minibuffer-header-default-message)
- (right (minibuffer-header--fit right width))
- )
+ (right (minibuffer-header--fit right width)))
(when minibuffer-header-hide-prompt
(add-text-properties prompt-beg prompt-end '(invisible t)))