public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCHSET] [3/4] Fix various issue in TUI
Date: Tue, 06 Jan 2015 15:58:00 -0000	[thread overview]
Message-ID: <831tn799zv.fsf@gnu.org> (raw)
In-Reply-To: <54AAE610.4050700@redhat.com>

> Date: Mon, 05 Jan 2015 19:29:20 +0000
> From: Pedro Alves <palves@redhat.com>
> 
> >  @item tabset @var{nchars}
> >  @kindex tabset
> > -Set the width of tab stops to be @var{nchars} characters.
> > +Set the width of tab stops to be @var{nchars} characters.  This
> > +setting affects the display of TAB characters in the source and
> > +assembly windows.
> >  @end table
> 
> (this is yet another setting that would be nicer if the TUI reflected
> updates immediately.)

Like this?

2015-01-06  Eli Zaretskii  <eliz@gnu.org>

	* tui/tui-win.c (tui_set_tab_width_command): Delete and
	recreate the source and the disassembly windows, to show the
	effect of the changed tab size immediately.

--- gdb/tui/tui-win.c~2	2015-01-04 08:07:30 +0200
+++ gdb/tui/tui-win.c	2015-01-06 08:03:05 +0200
@@ -1020,7 +1026,27 @@ tui_set_tab_width_command (char *arg, in
 
       ts = atoi (arg);
       if (ts > 0)
-	tui_set_default_tab_len (ts);
+	{
+	  tui_set_default_tab_len (ts);
+	  /* We don't really change the height of any windows, but
+	     calling these 2 functions causes a complete regeneration
+	     and redisplay of the window's contents, which will take
+	     the new tab width into account.  */
+	  if (tui_win_list[SRC_WIN]
+	      && tui_win_list[SRC_WIN]->generic.is_visible)
+	    {
+	      make_invisible_and_set_new_height (TUI_SRC_WIN,
+						 TUI_SRC_WIN->generic.height);
+	      make_visible_with_new_height (TUI_SRC_WIN);
+	    }
+	  if (tui_win_list[DISASSEM_WIN]
+	      && tui_win_list[DISASSEM_WIN]->generic.is_visible)
+	    {
+	      make_invisible_and_set_new_height (TUI_DISASM_WIN,
+						 TUI_DISASM_WIN->generic.height);
+	      make_visible_with_new_height (TUI_DISASM_WIN);
+	    }
+	}
       else
 	warning (_("Tab widths greater than 0 must be specified."));
     }

  reply	other threads:[~2015-01-06 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-31 17:50 Eli Zaretskii
2015-01-05 19:29 ` Pedro Alves
2015-01-06 15:58   ` Eli Zaretskii [this message]
2015-01-06 16:20     ` Pedro Alves
2015-01-16 15:55       ` Eli Zaretskii
2015-01-16 11:35   ` Eli Zaretskii

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=831tn799zv.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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).