From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1042 invoked by alias); 16 Aug 2019 13:55:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 1033 invoked by uid 89); 16 Aug 2019 13:55:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*RU:209.85.221.67, HX-Spam-Relays-External:209.85.221.67 X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Aug 2019 13:55:13 +0000 Received: by mail-wr1-f67.google.com with SMTP id r3so1646154wrt.3 for ; Fri, 16 Aug 2019 06:55:12 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id l62sm4873978wml.13.2019.08.16.06.55.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Aug 2019 06:55:10 -0700 (PDT) Subject: Re: [PATCH] Use less horizontal space in source window To: Tom Tromey , gdb-patches@sourceware.org References: <20190816023631.26830-1-tom@tromey.com> From: Pedro Alves Message-ID: Date: Fri, 16 Aug 2019 13:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190816023631.26830-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-08/txt/msg00360.txt.bz2 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