From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79949 invoked by alias); 19 Aug 2019 12:09:43 -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 79941 invoked by uid 89); 19 Aug 2019 12:09:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=appreciate, IMHO X-HELO: mail-lj1-f194.google.com Received: from mail-lj1-f194.google.com (HELO mail-lj1-f194.google.com) (209.85.208.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Aug 2019 12:09:42 +0000 Received: by mail-lj1-f194.google.com with SMTP id x3so1519314lji.5 for ; Mon, 19 Aug 2019 05:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gYxrLimCDbrEu8LB8QxZpbGBQbHMd28I81mCxOzYPcQ=; b=cuLv+jYlTa2p7Jzk7VprMrEDesNG58xKSznB2blz4sDNOwZc/RSHb2Ppc+5eoPIvzb mlX7aN4LS/GT2W5oURZr1g3vOeAdYHboK/IOb+b82NSgoSf48o/Xyj1xAMcVQgshd99i O6cXNFW58jIdV2+juI5g9Urb43BEnfaRVN7ILklDhc1wO8gT6NZQ7hLkmXour0qNT/cA YrJfikrr1+quL0F1Szkie0loP4mY9oHBB230Pw7wkqFiQfh8Mx58NdqpqElisoBgsSy0 uUxvIhsiWmEVg0trHw49MDN+KM+eKU757bMaaYNhbxtWrvQofPO+oKCS3tYGSLgoqkHA js+Q== MIME-Version: 1.0 References: <20190816023631.26830-1-tom@tromey.com> In-Reply-To: From: Ruslan Kabatsayev Date: Mon, 19 Aug 2019 12:09:00 -0000 Message-ID: Subject: Re: [PATCH] Use less horizontal space in source window To: Pedro Alves Cc: Tom Tromey , GDB Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00407.txt.bz2 Hello, On Fri, 16 Aug 2019 at 16:55, Pedro Alves wrote: > > 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. What if line numbering were inverted in colors (or made different in another way) or maybe separated by a vertical line from the source? My experience is with much wider sources, and I'd appreciate some optimization of horizontal space usage in GDB TUI. To me this change is definitely an improvement, so I'd like to have it in some form, not dropped completely. Thanks, Ruslan > > 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