This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Use less horizontal space in source window
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Fri, 16 Aug 2019 14:55:09 +0100
- Subject: Re: [PATCH] Use less horizontal space in source window
- References: <20190816023631.26830-1-tom@tromey.com>
On 8/16/19 3:36 AM, Tom Tromey wrote:
> The source window currently uses a field width of 6 for line numbers,
> and it further aligns to the next tab stop.
>
> This seemed a bit wasteful of horizontal space to me. This patch
> changes the TUI to compute the maximum field width needed for the
> current source file, and to only add a single space after the line
> number. Line numbers are now right justified, as well, which I think
> also looks better visually when scrolling.
I tried this out a bit, and IMHO the experience is worse than before, given
the left/right shifting when stepping as you move between source files.
E.g., try debugging gdb and running to main, and stepping into gdb_main.
And then all the way into captured_main_1. I much prefer that the
source window remains in the same place as I step through all
these things.
I'd probably be fine with reducing the width if we still had a reasonable
minimum that is enough to fit reasonably-sized source files. I think that
if we change this, we should also have more than one space between the line
number and the source though. One single space as in your patch makes it harder
to distinguish between what is a line and the source IMO. More so with
styling disabled.
I have to say that I find it a bit odd to be optimizing the horizontal space,
since the sources I debug (gdb!) mostly wrap around 80 cols, and my terminal
is usually much larger than that, so I always have tons of empty space
on the right side of the source window.
Thanks,
Pedro Alves