Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hannes Domani via Gdb-patches <gdb-patches@sourceware.org>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PING][PATCH v2] Fix multi-line strings in TuiWindow.write
Date: Fri, 4 Dec 2020 14:18:49 +0000 (UTC)	[thread overview]
Message-ID: <1529224928.468621.1607091529134@mail.yahoo.com> (raw)
In-Reply-To: <1529224928.468621.1607091529134.ref@mail.yahoo.com>

Ping.

Am Freitag, 20. November 2020, 01:01:43 MEZ hat Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> Folgendes geschrieben:

> Currently multi-line strings are all written to the first line.
>
> Since tui_copy_source_line sets the text variable to the start of the
> next line, the check for newline has to be done with the previous character.
>
> gdb/ChangeLog:
>
> 2020-11-19  Hannes Domani  <ssbssa@yahoo.de>
>
>     * python/py-tui.c (tui_py_window::output): Fix multi-line strings.
> ---
> v2:
> - Don't break multiple TuiWindow.write calls without newline characters.
> ---
> gdb/python/py-tui.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c
> index 95c71f1d2d..306bd7b801 100644
> --- a/gdb/python/py-tui.c
> +++ b/gdb/python/py-tui.c
> @@ -203,13 +203,13 @@ tui_py_window::output (const char *text)
>     {
>       wmove (handle.get (), cursor_y + 1, cursor_x + 1);
>
> +      const char *prev_text = text;
>       std::string line = tui_copy_source_line (&text, 0, 0,
>                           vwidth - cursor_x, 0);
>       tui_puts (line.c_str (), handle.get ());
>
> -      if (*text == '\n')
> +      if (text > prev_text && (text[-1] == '\n' || text[-1] == '\r'))
>     {
> -      ++text;
>       ++cursor_y;
>       cursor_x = 0;
>     }
> --
> 2.29.2

       reply	other threads:[~2020-12-04 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1529224928.468621.1607091529134.ref@mail.yahoo.com>
2020-12-04 14:18 ` Hannes Domani via Gdb-patches [this message]
2020-12-04 17:22   ` Simon Marchi
2020-12-04 18:23     ` Hannes Domani via Gdb-patches

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=1529224928.468621.1607091529134@mail.yahoo.com \
    --to=gdb-patches@sourceware.org \
    --cc=ssbssa@yahoo.de \
    /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