Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Expose isearch and suffix regions to widgets.
- X-seq: zsh-workers 38264
- From: m0viefreak <m0viefreak.cm@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Expose isearch and suffix regions to widgets.
- Date: Sun, 10 Apr 2016 15:10:39 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=Vzc78LNK5eu5nQe20DneYXPDVZxzN/QT7OMkyFBTRTE=; b=xIUfkApXdQkTPLmQRgvLhYpJX9iGTaaPZMoQEKdgEJXDya4PXDKlZe0ZZiSOBan/7/ p3p3bEdACKUvGunzbl8dJ5PHO+1bb1Dfyfdp1Igy4hSgTbof95IhHHT9Gr/6LABxesB6 3YyrYAfe1cUCd0Natj+nmqI/20vAnJL8yZ4ovFFSRLe9YAQKcBOYW/qsaoH2/QUOuVCE e14YYVkjbh6m0W+s4UkV5M6BgxMEnSCXA7rA40uhHgSkhpDz2nvwOwPBgi6Z5LKsdMzi kBu0QDzfDFDcXRmBhxZeOtSLPdfQTHM6wyd0wkWoienferwBiMY0LYCkIFLjfVk/aYCy BQpA==
- In-reply-to: <CAH+w=7a=z+BnQmv027+4+3=KCEGXgtVf7hs+aSp+aVqKLJnebQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1457905871-2808-1-git-send-email-m0viefreak.cm@googlemail.com> <CAH+w=7Z-xQKMoNVK2MeOyj1ND22B8-yceU8FSfCp3xm6kyKEzQ@mail.gmail.com> <CAH+w=7a=z+BnQmv027+4+3=KCEGXgtVf7hs+aSp+aVqKLJnebQ@mail.gmail.com>
On 10.04.2016 07:35, Bart Schaefer wrote:
>> Sorry for the belated reply to this, but could you provide an example
>> in which the ISEARCH_* variables are useful?
Like the patch 36445 for yank, this is used by the
zsh-syntax-highlighting script. With this change, the matched part of
BUFFER can be queried in zle-isearch-update (and something like the
zle_highlight array can be re-created on top of other highlighting,
which was impossible before).
> And if the answer is going to be "during zle-isearch-update" then
> won't ISEARCH_ACTIVE always be true?
No, I actually made a mistake in the docs for the original patch.
ISEARCH_ACTIVE does not describe the fact that the minibuffer is active,
but the fact that a pattern that was typed in there does actually
matches the BUFFER. If the search pattern does not match ("failing
bck-i-search:") nothing is being underlined, and ISEARCH_ACTIVE will be 0.
I attached a small patch to improve the wording in the docs.
From 87aaf78284752d04873aff4ece710ccc3279c563 Mon Sep 17 00:00:00 2001
From: m0viefreak <m0viefreak.cm@xxxxxxxxxxxxxx>
Date: Sun, 10 Apr 2016 14:57:51 +0200
Subject: [PATCH] Improve wording of the ISEARCH_ACTIVE parameter.
---
Doc/Zsh/zle.yo | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 161cef7..c482a46 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -841,10 +841,11 @@ vindex(ISEARCH_END)
xitem(tt(ISEARCH_ACTIVE) (integer))
xitem(tt(ISEARCH_START) (integer))
item(tt(ISEARCH_END) (integer))(
-tt(ISEARCH_ACTIVE) indicates whether an incremental search minibuffer
-is active. tt(ISEARCH_START) and tt(ISEARCH_END) give the location of
-the matched pattern and are in the same units as tt(CURSOR). They are
-only valid for reading when tt(ISEARCH_ACTIVE) is non-zero.
+tt(ISEARCH_ACTIVE) indicates whether a part of the tt(BUFFER) is
+currently matched by an incremental search pattern. tt(ISEARCH_START)
+and tt(ISEARCH_END) give the location of the matched part and are
+in the same units as tt(CURSOR). They are only valid for reading
+when tt(ISEARCH_ACTIVE) is non-zero.
All parameters are read-only.
)
--
2.7.4
Messages sorted by:
Reverse Date,
Date,
Thread,
Author