Forcing a redraw of a line only when it contains a multicolumn character,
as that is the only known situation where things go wrong. This spares all regular text a significant slowdown. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5370 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
9205c28865
commit
954d04bc59
|
@ -1,3 +1,9 @@
|
|||
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-09-04 Benno Schulenberg <bensberg@justemail.net>
|
||||
* src/chars.c: Reverting r5354 from August 12. This fixes Savannah
|
||||
bug #45874. Apparently there is /some/ state somewhere after all.
|
||||
|
|
|
@ -40,6 +40,8 @@ static int statusblank = 0;
|
|||
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;
|
||||
|
||||
|
@ -1896,6 +1898,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
|
|||
converted = charalloc(alloc_len);
|
||||
|
||||
index = 0;
|
||||
seen_wide = FALSE;
|
||||
|
||||
if (buf[start_index] != '\0' && buf[start_index] != '\t' &&
|
||||
(column < start_col || (dollars && column > 0))) {
|
||||
|
@ -1939,6 +1942,9 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
|
|||
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. */
|
||||
|
@ -2472,7 +2478,8 @@ void edit_draw(filestruct *fileptr, const char *converted, int
|
|||
/* 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
|
||||
|
|
Loading…
Reference in New Issue