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.
}
}
+ # 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
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
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
}