public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Andrei Pikas <gdb@mail.api.win>, Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 (mentions of reverse mode eliminated)] Add style tui-cursorline command to colorize TUI current line.
Date: Mon, 18 Jul 2022 15:16:09 +0100	[thread overview]
Message-ID: <87tu7eqzfa.fsf@redhat.com> (raw)
In-Reply-To: <f60e79ae-6ed4-b298-f43c-5876e9dc62ea@mail.api.win>

Andrei Pikas <gdb@mail.api.win> writes:

>  > I think I'd prefer a hyphen in there, since "cursorline" isn't a word.
>  > So, tui-cursor-line.  But why "cursor" and not "current"? "current
>  > line" seems to be the term used in the gdb manual.
>
> I chose this name to match vim for those who familiar with :set 
> cursorline. OK, I'll change it to tui-cursor-line. Or would you prefer 
> tui-current-line?
>
>
>
>  > Andrei> @@ -54,6 +54,28 @@ static const char * const cli_colors[] = {
>  > Andrei>    "magenta",
>  > Andrei>    "cyan",
>  > Andrei>    "white",
>  > Andrei> +  "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", 
> "18", "19", "20",
>  >
>  > What's this for?
>
> This is to support all 256 colors 
> https://www.ditig.com/256-colors-cheat-sheet . I want to use the 
> lightest shade of gray #255 for the background.

Thanks.  I've been playing with adding 256 colour support to GDB.

I think this change is big enough that it should be split into a
separate patch.  It certainly deserves its own NEWS entry, and probably
requires a docs update to indicate what all these (seemingly) random
numbers mean.

Thanks,
Andrew



>
>
>  > Andrei>      case '\n':
>  > Andrei> +          if (wattr_get (w, &w_attrs, &w_pair, nullptr) == OK)
>  > Andrei> +            /* Apply current style till the end of line. */
>  > Andrei> +            wchgat (w, -1, w_attrs, w_pair, nullptr);
>  >
>  > I don't think this is correct, because the source window may not extend
>  > to the end of the line.
>
> I tested for long line. It doesn't seem to be a problem (screenshot 
> https://drive.google.com/file/d/1lMgdR9cTNEQJAz05wO7TCgd3SVYOdXyP/view?usp=sharing 
> ).
>
> I think -1 handles this case: "A character count of -1 or greater than 
> the remaining window width means to change attributes all the way to the 
> end of the current line." from https://linux.die.net/man/3/wchgat
>
> I can rewrite this line as wchgat (w, std::max (0, getmaxx (w) - getcurx 
> (w)), w_attrs, w_pair, nullptr). But I think it's the same.


  reply	other threads:[~2022-07-18 14:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09 19:05 [PATCH] Add style tui-reverse " Andrei Pikas
2022-07-09 19:10 ` Eli Zaretskii
2022-07-09 20:20   ` [PATCH] Add style tui-cursorline " Andrei Pikas
2022-07-10  5:03     ` Eli Zaretskii
2022-07-10 10:10       ` [PATCH v2 (mentions of reverse mode eliminated)] " Andrei Pikas
2022-07-10 10:19         ` Eli Zaretskii
2022-07-15 19:40         ` Tom Tromey
2022-07-15 22:06           ` Andrei Pikas
2022-07-18 14:16             ` Andrew Burgess [this message]
2022-07-18 15:32               ` Andrei Pikas
2022-07-18 18:12               ` Tom Tromey
2022-07-15 22:49           ` [PATCH v3] Add style tui-current-line " Andrei Pikas
2022-07-16  5:35             ` Eli Zaretskii
2022-07-18 14:30             ` Andrew Burgess
2022-07-18 19:11               ` [PATCH v4 (fix formatting and revert cli_colors to original state)] " Andrei Pikas
2022-07-18 19:14                 ` Eli Zaretskii
2022-07-18 19:16                   ` Andrei Pikas

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=87tu7eqzfa.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gdb@mail.api.win \
    --cc=tom@tromey.com \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).