+2015-09-05 Benno Schulenberg <bensberg@justemail.net>
+ * src/winio.c (display_string, edit_draw): Force a redraw of a line
+ only when it contains a multicolumn character, to spare all regular
+ text this significant slowdown. This fixes Savannah bug #45684
+ reported by Wyatt Ward.
+
2015-08-14 Benno Schulenberg <bensberg@justemail.net>
* src/help.c (help_line_len): The wrap location can be beyond the EOL,
so for determining the length of the current line, don't start at that
static bool disable_cursorpos = FALSE;
/* Should we temporarily disable constant cursor position
* display? */
+static bool seen_wide = FALSE;
+ /* Whether we've seen a multicolumn character in the current line. */
static sig_atomic_t sigwinch_counter_save = 0;
converted = charalloc(alloc_len);
index = 0;
+ seen_wide = FALSE;
if (buf[start_index] != '\0' && buf[start_index] != '\t' &&
(column < start_col || (dollars && column > 0))) {
while (buf[start_index] != '\0') {
buf_mb_len = parse_mbchar(buf + start_index, buf_mb, NULL);
+ if (mbwidth(buf + start_index) > 1)
+ seen_wide = TRUE;
+
/* Make sure there's enough room for the next character, whether
* it's a multibyte control character, a non-control multibyte
* character, a tab character, or a null terminator. */
/* Tell ncurses to really redraw the line without trying to optimize
* for what it thinks is already there, because it gets it wrong in
* the case of a wide character in column zero. See bug #31743. */
- wredrawln(edit, line, 1);
+ if (seen_wide)
+ wredrawln(edit, line, 1);
#endif
#ifndef DISABLE_COLOR