From: m0viefreak <m0viefreak.cm@googlemail.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] Expose isearch and suffix regions to widgets.
Date: Sun, 10 Apr 2016 15:10:39 +0200 [thread overview]
Message-ID: <570A50CF.2000600@googlemail.com> (raw)
In-Reply-To: <CAH+w=7a=z+BnQmv027+4+3=KCEGXgtVf7hs+aSp+aVqKLJnebQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 970 bytes --]
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.
[-- Attachment #2: 0001-Improve-wording-of-the-ISEARCH_ACTIVE-parameter.patch --]
[-- Type: text/plain, Size: 1203 bytes --]
From 87aaf78284752d04873aff4ece710ccc3279c563 Mon Sep 17 00:00:00 2001
From: m0viefreak <m0viefreak.cm@googlemail.com>
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
next prev parent reply other threads:[~2016-04-10 15:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-13 21:51 m0viefreak
2016-03-21 9:47 ` Peter Stephenson
2016-03-21 16:11 ` Daniel Shahaf
2016-04-10 5:26 ` Bart Schaefer
2016-04-10 5:35 ` Bart Schaefer
2016-04-10 13:10 ` m0viefreak [this message]
2016-04-11 6:16 ` Daniel Shahaf
2016-04-11 14:25 ` Bart Schaefer
2016-04-16 16:17 ` m0viefreak
2016-04-23 21:36 ` Daniel Shahaf
2016-04-23 22:33 ` Bart Schaefer
2016-04-25 8:19 ` Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=570A50CF.2000600@googlemail.com \
--to=m0viefreak.cm@googlemail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).