diff options
author | Tom de Vries <tdevries@suse.de> | 2023-11-13 21:22:50 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-11-13 21:22:50 +0100 |
commit | ff3c86a844225a0f8848b2aee0b1628114c01377 (patch) | |
tree | e5acefcea5741da303caba64eb4dbd309ba11d15 /Makefile.tpl | |
parent | 70911fd87f261d3726fea4699a4ffdd5623482b7 (diff) | |
download | gdb-ff3c86a844225a0f8848b2aee0b1628114c01377.zip gdb-ff3c86a844225a0f8848b2aee0b1628114c01377.tar.gz gdb-ff3c86a844225a0f8848b2aee0b1628114c01377.tar.bz2 |
[gdb/tui] Add tui_win_info::{box_width,box_size}
In tui_source_window::set_contents we have:
...
/* Take hilite (window border) into account, when
calculating the number of lines. */
int nlines = height - 2;
...
The '2' represents the total size of the window border (or box, in can_box
terms), in this case one line at the top and one line at the bottom.
Likewise, '1' is used to represent the width of the window border.
Introduce new functions:
- tui_win_info::box_width () and
- tui_win_info::box_size ()
that can be used instead instead of these hardcoded constants.
Implement these such that they return 0 when can_box () == false.
Tested patch completeness by making all windows unboxed:
...
@@ -85,7 +85,7 @@ struct tui_win_info
/* Return true if this window can be boxed. */
virtual bool can_box () const
{
- return true;
+ return false;
}
int box_width () const
...
and test-driving TUI.
This required eliminating an assert in
tui_source_window_base::show_source_content, I've included that part as well.
Tested on x86_64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'Makefile.tpl')
0 files changed, 0 insertions, 0 deletions