From b7539ea9853cd3cdab5c4d3453ac3b3afe26d49b Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 15 Nov 2020 10:21:51 +0100 Subject: [PATCH] weeding: remove a workaround for versions of ncurses before 5.9 (Yes, the test is for 6.0, but the bug was actually fixed in 5.9, as far as I remember -- I just wasn't sure and didn't want to bother building different versions of ncurses myself.) --- src/definitions.h | 4 ---- src/winio.c | 19 ------------------- 2 files changed, 23 deletions(-) diff --git a/src/definitions.h b/src/definitions.h index 6d4809ac..b79a6218 100644 --- a/src/definitions.h +++ b/src/definitions.h @@ -85,10 +85,6 @@ #include #endif /* CURSES_H */ -#if defined(NCURSES_VERSION_MAJOR) && (NCURSES_VERSION_MAJOR < 6) -#define USING_OLD_NCURSES yes -#endif - #ifdef ENABLE_NLS /* Native language support. */ #ifdef HAVE_LIBINTL_H diff --git a/src/winio.c b/src/winio.c index 1efbef23..fca08360 100644 --- a/src/winio.c +++ b/src/winio.c @@ -51,10 +51,6 @@ static bool linger_after_escape = FALSE; /* Whether to give ncurses some time to get the next code. */ static int statusblank = 0; /* The number of keystrokes left before we blank the status bar. */ -#ifdef USING_OLD_NCURSES -static bool seen_wide = FALSE; - /* Whether we've seen a multicolumn character in the current line. */ -#endif static bool has_more = FALSE; /* Whether the current line has more text after the displayed part. */ static bool is_shorter = TRUE; @@ -1720,9 +1716,6 @@ char *display_string(const char *buf, size_t column, size_t span, size_t beyond = column + span; /* The column number just beyond the last shown character. */ -#ifdef USING_OLD_NCURSES - seen_wide = FALSE; -#endif buf += start_index; /* Allocate enough space for converting the relevant part of the line. */ @@ -1855,11 +1848,6 @@ char *display_string(const char *buf, size_t column, size_t span, /* If the codepoint is unassigned, assume a width of one. */ column += (charwidth < 0 ? 1 : charwidth); - -#ifdef USING_OLD_NCURSES - if (charwidth > 1) - seen_wide = TRUE; -#endif #endif /* ENABLE_UTF8 */ } @@ -2342,13 +2330,6 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) if (thebar) mvwaddch(edit, row, COLS - 1, bardata[row]); #endif -#ifdef USING_OLD_NCURSES - /* 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. */ - if (seen_wide) - wredrawln(edit, row, 1); -#endif #ifdef ENABLE_COLOR /* If there are color rules (and coloring is turned on), apply them. */