[PATCH] Truncate long TUI window titles

Andrew Burgess andrew.burgess@embecosm.com
Wed Sep 4 11:07:00 GMT 2019


* Tom Tromey <tom@tromey.com> [2019-09-03 17:33:33 -0600]:

> >>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
> 
> >> +      /* 2 chars for the corners, plus 3 more for the indent that's
> >> +	 used below.  */
> >> +      int max_len = win_info->width - 2 - 3;
> 
> Andrew> I didn't really understand this comment.  Currently long titles will
> Andrew> be laid out like this:  +--...long title-+
> 
> Andrew> You claim 2 for the corners, and 3 for the indent, but this seems an
> Andrew> odd way of describing it, why not just say 3 for the left edge and 2
> Andrew> for the right edge?
> 
> No reason, I will change it.

Thanks, I just got confused as I assumed "indent below" was the
"...".  I get confused easily!

> 
> Andrew> Also, is there a reason why you went with a 3/2 split for the top
> Andrew> border rather than having a balanced 3/3 or 2/2?
> 
> No particularly good reason.  I didn't change the left hand side to
> preserve the historical decision.  On the right I thought it would be
> good to use as much space as possible, but still leave one "-" to make
> it still resemble a line.  3 would work just as well -- I just didn't
> give it a whole lot of consideration.

I don't really mind, it just looked a bit weird and I thought there
might be an off-by-one bug in the code. I'd personally be happy with a
2/2 split.

In fact, given that no (sane) person is going to be pattern matching
against the TUI output we could be a little more dynamic.  What if we
kept the 3 on the left for short titles, but moved to 2 of the left
once titles get long enough?

But meh, the patch works for me, and is a million times better than
before, so I'm happy with whatever you choose to push.

Thanks,
Andrew

> 
> One thing I did consider is trying harder to truncate the file name at a
> directory boundary.  This can always be done if desirable, though.
> 
> Tom



More information about the Gdb-patches mailing list