From: Pedro Alves <palves@redhat.com>
To: Patrick Palka <patrick@parcs.ath.cx>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix truncation of TUI command history
Date: Tue, 10 Feb 2015 17:30:00 -0000 [thread overview]
Message-ID: <54DA4014.4010602@redhat.com> (raw)
In-Reply-To: <1420861759-10700-2-git-send-email-patrick@parcs.ath.cx>
On 01/10/2015 03:49 AM, Patrick Palka wrote:
> We need to move the cursor because
> when ncurses outputs a newline it truncates any text that appears
> past the end of the cursor.
Can you merge this sentence into the comment in the code?
> else
> {
> - wmove (w, TUI_CMD_WIN->detail.command_info.cur_line,
> - TUI_CMD_WIN->detail.command_info.curch);
> - waddch (w, ch);
> + /* Move cursor to the end of the command line before emitting the
> + newline. */
... as this as is doesn't explain _why_ we need to do that, which
may make the reader wonder.
> + int px = TUI_CMD_WIN->detail.command_info.curch;
> + int py = TUI_CMD_WIN->detail.command_info.cur_line;
> + px += rl_end - rl_point;
> + py += px / TUI_CMD_WIN->generic.width;
> + px %= TUI_CMD_WIN->generic.width;
> + wmove (w, py, px);
> + waddch (w, ch);
> }
> }
>
>
OK with that change. Thanks!
Thanks,
Pedro Alves
next prev parent reply other threads:[~2015-02-10 17:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-10 3:49 [PATCH] Fix a pair of screen-resizing issues in TUI Patrick Palka
2015-01-10 3:49 ` [PATCH] Fix truncation of TUI command history Patrick Palka
2015-01-10 3:59 ` Patrick Palka
2015-01-27 2:13 ` Patrick Palka
2015-02-04 14:50 ` Patrick Palka
2015-02-10 17:30 ` Pedro Alves [this message]
2015-01-10 3:56 ` [PATCH] Fix a pair of screen-resizing issues in TUI Patrick Palka
2015-01-26 21:55 ` Patrick Palka
2015-02-04 14:49 ` Patrick Palka
2015-02-10 17:27 ` Pedro Alves
-- strict thread matches above, loose matches on Subject: below --
2014-08-30 18:11 [PATCH] Fix truncation of TUI command history Patrick Palka
2014-09-04 9:44 ` Pedro Alves
2014-09-04 12:17 ` Patrick Palka
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=54DA4014.4010602@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=patrick@parcs.ath.cx \
/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).