Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: fix to highlight layers where special is assigned a low layer



In the layer code, it needs to find the minimum remaining layer and
seeds the minimum with the "special" layer which has a high default
value. But when set to something lower, this would stop it finding
anything higher.

I suspect the layers haven't really seen much testing. Looking at
mixattrs() again, I'm less sure that is doing what users might expect.
And I'm reminded of the point Marlon made (47445) that fg=default
is the same as none so losing the explicit sense that we want a
default foreground colour. mixattrs needs a mask to separate explicit
attributes.

The special layer is used for things like embedded control characters.
Where might be a suitable place to add a configuration toggle to use the
unicode forms like ␈ (\u2408) instead of the current ASCII forms like
^H?

Oliver

diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index e89daf506..6779d9f5d 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1221,7 +1221,8 @@ zrefresh(void)
 			if (layer > special_layer)
 			    all_attr = mixattrs(rhp->atr, all_attr);
 		    }
-		} else if (rhp->layer > layer && rhp->layer < nextlayer) {
+		} else if (rhp->layer > layer &&
+			(rhp->layer < nextlayer || nextlayer <= layer)) {
 		    nextlayer = rhp->layer;
 		}
 	    }





Messages sorted by: Reverse Date, Date, Thread, Author