Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Use [0]. for the first element of region_highlights.
- X-seq: zsh-workers 29681
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Use [0]. for the first element of region_highlights.
- Date: Sun, 14 Aug 2011 15:26:33 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer; bh=yOv9y+qUjOJnDTiBjC3zFxh6qRhqVzoqDdZIiPcoNiY=; b=o/YlC7Uke8jGo4DEiWJXRe6sTm/CA51PBxWUuSPSemYWNB8Uw9MZ69vb4BnCFYHDj3 8sEJYgAotI8N9l2w4EMxNepV4nxsiGeZ68BhKNTZlZaX1pt5vMsqwCHvkEf1OLEYVG6f znh+aCWXdK5EUUBG/d/geLQpi3pEv2BfRmOiQ=
- 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
I think this makes the code slightly less confusing, possibly.
---
Src/Zle/zle_refresh.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 05809f3..73687ac 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -339,11 +339,11 @@ zle_set_highlight(void)
match_highlight(*atrs + 8, &default_atr_on);
} else if (strpfx("special:", *atrs)) {
match_highlight(*atrs + 8, &special_atr_on);
special_atr_on_set = 1;
} else if (strpfx("region:", *atrs)) {
- match_highlight(*atrs + 7, ®ion_highlights->atr);
+ match_highlight(*atrs + 7, ®ion_highlights[0].atr);
region_atr_on_set = 1;
} else if (strpfx("isearch:", *atrs)) {
match_highlight(*atrs + 8, &(region_highlights[1].atr));
isearch_atr_on_set = 1;
} else if (strpfx("suffix:", *atrs)) {
@@ -355,11 +355,11 @@ zle_set_highlight(void)
/* Defaults */
if (!special_atr_on_set)
special_atr_on = TXTSTANDOUT;
if (!region_atr_on_set)
- region_highlights->atr = TXTSTANDOUT;
+ region_highlights[0].atr = TXTSTANDOUT;
if (!isearch_atr_on_set)
region_highlights[1].atr = TXTUNDERLINE;
if (!suffix_atr_on_set)
region_highlights[2].atr = TXTBOLDFACE;
@@ -1039,18 +1039,18 @@ zrefresh(void)
zle_set_highlight();
/* check for region between point ($CURSOR) and mark ($MARK) */
if (region_active) {
if (zlecs <= mark) {
- region_highlights->start = zlecs;
- region_highlights->end = mark;
+ region_highlights[0].start = zlecs;
+ region_highlights[0].end = mark;
} else {
- region_highlights->start = mark;
- region_highlights->end = zlecs;
+ region_highlights[0].start = mark;
+ region_highlights[0].end = zlecs;
}
} else {
- region_highlights->start = region_highlights->end = -1;
+ region_highlights[0].start = region_highlights[0].end = -1;
}
/* check for isearch string to highlight */
if (isearch_active) {
region_highlights[1].start = isearch_startpos;
region_highlights[1].end = isearch_endpos;
--
1.7.5.4
Messages sorted by:
Reverse Date,
Date,
Thread,
Author