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 | 5fa871f5d93bf285753f219cf583d0763dc0cd33 (patch) | |
tree | 61a88157a6af44dcf5d15e09ab8e9d47489613c3 /gdb/tui | |
parent | ff3c86a844225a0f8848b2aee0b1628114c01377 (diff) | |
download | gdb-5fa871f5d93bf285753f219cf583d0763dc0cd33.zip gdb-5fa871f5d93bf285753f219cf583d0763dc0cd33.tar.gz gdb-5fa871f5d93bf285753f219cf583d0763dc0cd33.tar.bz2 |
[gdb/tui] Don't include border_width in left_margin
Currently left_margin does not match its documentation:
...
/* Return the size of the left margin space, this is the space used to
display things like breakpoint markers. */
int left_margin () const
{ return box_width () + TUI_EXECINFO_SIZE + extra_margin (); }
...
It is stated that the left margin is reserved to display things, but
the box_width is not used for that.
Fix this by dropping box_width () from the left_margin calculation.
Tested on x86_64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-winsource.c | 2 | ||||
-rw-r--r-- | gdb/tui/tui-winsource.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 83ce480..ea4ca21 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -348,7 +348,7 @@ tui_source_window_base::refresh_window () gdb_assert (pad_x + view_width <= pad_width || m_pad.get () == nullptr); int sminrow = y + box_width (); - int smincol = x + left_margin; + int smincol = x + box_width () + left_margin; int smaxrow = sminrow + m_content.size () - 1; int smaxcol = smincol + view_width - 1; prefresh (m_pad.get (), 0, pad_x, sminrow, smincol, smaxrow, smaxcol); diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index dccce0e..c282616 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -206,13 +206,13 @@ private: /* Return the size of the left margin space, this is the space used to display things like breakpoint markers. */ int left_margin () const - { return box_width () + TUI_EXECINFO_SIZE + extra_margin (); } + { return TUI_EXECINFO_SIZE + extra_margin (); } /* Return the width of the area that is available for window content. This is the window width minus the borders and the left margin, which is used for displaying things like breakpoint markers. */ int view_width () const - { return width - left_margin () - box_width (); } + { return width - left_margin () - box_size (); } void show_source_content (); |