From: Tom Tromey <tom@tromey.com>
To: Andrei Pikas <gdb@mail.api.win>
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: Fri, 15 Jul 2022 13:40:20 -0600 [thread overview]
Message-ID: <87tu7imafv.fsf@tromey.com> (raw)
In-Reply-To: <20220710101003.4245-1-gdb@mail.api.win> (Andrei Pikas's message of "Sun, 10 Jul 2022 13:10:03 +0300")
>>>>> "Andrei" == Andrei Pikas <gdb@mail.api.win> writes:
Andrei> Adds the ability to customize the colors of the current line of code in TUI.
Andrei> This may be desirable when code highlighting is enabled. Because higlighted
Andrei> keywords in dark blue color are indistinguishable from a black background
Andrei> (which is the default inverse color for a white terminal).
Andrei> Here is a screenshot of old and new behavior
Andrei> https://drive.google.com/file/d/1BbgNwpFa0DvKX0K9UAd48dEgtn8aChXP/view
Thank you for the patch.
Andrei> +set style tui-cursorline foreground COLOR
Andrei> +set style tui-cursorline background COLOR
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.
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?
Andrei> +static bool
Andrei> +get_custom_cursorline_style (ui_file_style *style)
Andrei> +{
Please add an introductory comment explaining the purpose of the
function.
Andrei> + ui_file_style cursorline_style = tui_cursorline_style.style();
Space before "(". There are a couple instances of this here.
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.
Tom
next prev parent reply other threads:[~2022-07-15 19:40 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 [this message]
2022-07-15 22:06 ` Andrei Pikas
2022-07-18 14:16 ` Andrew Burgess
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=87tu7imafv.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=gdb@mail.api.win \
/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).