Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: region_highlight converts `fg=default` to `none`, which is not the same
- X-seq: zsh-workers 47446
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Marlon Richert <marlon.richert@xxxxxxxxx>
- Subject: Re: region_highlight converts `fg=default` to `none`, which is not the same
- Date: Tue, 13 Oct 2020 13:05:39 +0200
- Archived-at: <https://zsh.org/workers/47446>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-10/CAN%3D4vMq1CjLKiwM0_HWfQf5%3DxLTGQ7z9mVs%3DQEsCp05suLK-fA%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-io1-f48.google.com) smtp.remote-ip=209.85.166.48; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gUAgiZknIE32zrckLmvSs40x1qnD3lPjOXER7VulFmQ=; b=tEpjPVZVXEK1qI/yq1MgGySttrsi2Dt4+PrnWbE4tnHr+TZkBdNQJFWoiV6CoD9Bt+ kwXvug9ZOBNmbyqi+77GKtRMLDQBTgjvVSbGGmS/u+xC16LSOhjkXX6+Kg9LGDnxMbwV FKbcgsGHDGWGe7fhOI5/17cQdBffMHy0a1H3jeXZ8seD5I+X/O/jemqJ7ouaLqrWCdZV rAPK3+DN4WtbgKVxm+Q2Mh0wUIxUoesx6wqsNvWOIw5PgGj2Pld1UxYV8v/I6VB2vhEU D7Axc/9WnmnyZL4RHcRtm2/YvV+RtuwC082i7MkWa6AKzd+RoXkGdnFAI3qDIZOcNusc 3ZUA==
- In-reply-to: <CAHLkEDv9ch+nhtpYF3So+029J6GMv5iU-8=RzHRHLa7OYzc3kg@mail.gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <CAHLkEDv9ch+nhtpYF3So+029J6GMv5iU-8=RzHRHLa7OYzc3kg@mail.gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Mon, Oct 12, 2020 at 11:23 AM Marlon Richert
<marlon.richert@xxxxxxxxx> wrote:
>
> 1. It seems incorrect to convert `fg=default` to `none`. From reading the [documentation](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting), `none` is not supposed to be the same as `fg=default`.
I took a quick look at this yesterday. When you print region_highlight
and "fg=default" comes out as "none", that's a bug in the printing
logic (function output_highlight in Src/prompt.c). It's fairly easy to
fix -- patch below (only for fg; bg should be handled similarly).
Naturally, it doesn't solve the other issues you've described. I
haven't looked at why the highlight doesn't get applied as it should
be.
Roman.
P.S.
zsh-workers is the correct mailing list for this discussion.
diff --git a/Src/prompt.c b/Src/prompt.c
index 997327e18..36c828321 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -1842,6 +1842,13 @@ output_highlight(zattr atr, char *buf)
atrlen += len;
if (buf)
ptr += len;
+ } else if (atr & TXTNOFGCOLOUR) {
+ len = 10;
+ atrlen += len;
+ if (buf) {
+ strcpy(ptr, "fg=default");
+ ptr += len;
+ }
}
if (atr & TXTBGCOLOUR) {
if (atrlen) {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author