zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] region_highlight+=( "$start $end standout" ) doesn't work as expected
Date: Sun, 09 Dec 2018 19:48:54 +0000	[thread overview]
Message-ID: <b1dac28f8777d6b1b9e50fbd1b27c286698d047c.camel@ntlworld.com> (raw)
In-Reply-To: <CAKc7PVBKnrmZTRZhd-_pjeyb8GnHAqz5t5zwzHZU23vYfXcVqQ@mail.gmail.com>

On Sun, 2018-12-09 at 20:20 +0100, Sebastian Gniazdowski wrote:
> I think I've already resolved this in the patch in email "[PATCH] Make
> 256 color codes be based on zle_highlight array, not on termcap".

Ah, just those two lines as below?  I hadn't realised that was the same
issue.  I'm happy to commit them on the basis you've got the most
experience with this support, though I suppose I ought to give Oliver
the chance to comment.

Certainly termcap is a bit defective in this sort of support, so
I can believe it.

pws

diff --git a/Src/prompt.c b/Src/prompt.c
index 568bfc2a9..50c51e479 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -2067,6 +2067,11 @@ set_colour_attribute(zattr atr, int fg_bg, int
flags)
     } else if (use_truecolor) {
 	ptr += sprintf(ptr, "8;2;%d;%d;%d", colour >> 16,
 		(colour >> 8) & 0xff, colour & 0xff);
+    } else if (use_truecolor) {
+        ptr += sprintf(ptr, "8;2;%d;%d;%d", colour >> 16,
+                (colour >> 8) & 0xff, colour & 0xff);
+    } else if (colour > 7 && colour <= 255) {
+        ptr += sprintf(ptr, "8;5;%d", colour);
     } else
 	*ptr++ = colour + '0';
     strcpy(ptr, fg_bg_sequences[fg_bg].end);


  reply	other threads:[~2018-12-09 19:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06  7:03 Sebastian Gniazdowski
2018-12-07  1:42 ` Sebastian Gniazdowski
2018-12-07  7:45   ` Daniel Shahaf
2018-12-07 15:04     ` Sebastian Gniazdowski
2018-12-09 18:49       ` Peter Stephenson
2018-12-09 19:20         ` Sebastian Gniazdowski
2018-12-09 19:48           ` Peter Stephenson [this message]
2018-12-09 20:19             ` Sebastian Gniazdowski
2018-12-09 20:56               ` Peter Stephenson

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=b1dac28f8777d6b1b9e50fbd1b27c286698d047c.camel@ntlworld.com \
    --to=p.w.stephenson@ntlworld.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).