public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH] [gdb/tui] Fix tui compact-source
Date: Tue, 9 May 2023 20:18:46 +0200	[thread overview]
Message-ID: <e13b5e80-131e-9f5f-0029-f10ebcb3abb8@suse.de> (raw)
In-Reply-To: <20230509174422.13362-1-tdevries@suse.de>

On 5/9/23 19:44, Tom de Vries via Gdb-patches wrote:
> The abbreviation is due to allocating space for <lines in source>, which is
> 8 for this example, and takes a single digit.  The line numbers though
> continue past the end of the file, so fix this by allocating space for
> max (<lines in source>, <lines in window>), which is 21 in this example, and
> takes 2 digits.

Right after sending this, I found a bug in this fix.

It's not the <lines in window> that matters, it's the <last line nr in 
window>.  So, at the point that the we go from:
...
|___09_                     |
|___10_                     |
+---------------------------+
...
to:
...
|___8_}                     |
|___9_                      |
+---------------------------+
...
the number of digits needed should drop from 2 to 1, and that was not 
the case.

I've fixed this, updated the test-case and submitted a v2 ( 
https://sourceware.org/pipermail/gdb-patches/2023-May/199447.html ).

Thanks,
- Tom

      reply	other threads:[~2023-05-09 18:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 17:44 Tom de Vries
2023-05-09 18:18 ` Tom de Vries [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e13b5e80-131e-9f5f-0029-f10ebcb3abb8@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).