public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Factor out Term::_reset_attrs Date: Mon, 22 May 2023 09:38:10 +0000 (GMT) [thread overview] Message-ID: <20230522093810.1264B3858D20@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a01399ff21e35422868c3853a31811c301a73883 commit a01399ff21e35422868c3853a31811c301a73883 Author: Tom de Vries <tdevries@suse.de> Date: Mon May 22 11:38:08 2023 +0200 [gdb/testsuite] Factor out Term::_reset_attrs Factor out new proc Term::_reset_attrs. Tested by re-running the TUI test-cases (gdb.tui/*.exp and gdb.python/tui*.exp) on x86_64-linux. Diff: --- gdb/testsuite/lib/tuiterm.exp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index 64a883e89a3..361fce83a79 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -547,6 +547,18 @@ namespace eval Term { } } + # Reset the attributes in attributes array UPVAR_NAME to the default values. + proc _reset_attrs { upvar_name } { + upvar $upvar_name var + array set var { + intensity normal + fg default + bg default + underline 0 + reverse 0 + } + } + # Select Graphic Rendition. # # https://vt100.net/docs/vt510-rm/SGR.html @@ -557,11 +569,7 @@ namespace eval Term { foreach item $args { switch -exact -- $item { "" - 0 { - set _attrs(intensity) normal - set _attrs(fg) default - set _attrs(bg) default - set _attrs(underline) 0 - set _attrs(reverse) 0 + _reset_attrs _attrs } 1 { set _attrs(intensity) bold @@ -666,13 +674,7 @@ namespace eval Term { set _cur_col 0 set _cur_row 0 set _resize_count 0 - array set _attrs { - intensity normal - fg default - bg default - underline 0 - reverse 0 - } + _reset_attrs _attrs _clear_lines 0 $_rows }
reply other threads:[~2023-05-22 9:38 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230522093810.1264B3858D20@sourceware.org \ --to=vries@sourceware.org \ --cc=gdb-cvs@sourceware.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: linkBe 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).