From 1be0285832f361e8203e02f91c429e240e28d8ee Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 3 Jan 2020 12:00:06 +0100 Subject: [PATCH] tweaks: delete some fragments of code that have become irrelevant Since the previous commit, USE_SLANG can only be defined when NANO_TINY is also defined. This means that code that is present only in non-tiny versions does not need to cater for Slang. --- src/nano.c | 11 +---------- src/winio.c | 11 ----------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/nano.c b/src/nano.c index 289317d6..be1626a1 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1308,7 +1308,7 @@ void regenerate_screen(void) /* We could check whether COLS or LINES changed, and return otherwise, * but it seems curses does not always update these global variables. */ -#if defined(USE_SLANG) || defined(REDEFINING_MACROS_OK) +#ifdef REDEFINING_MACROS_OK COLS = win.ws_col; LINES = win.ws_row; #endif @@ -1317,19 +1317,10 @@ void regenerate_screen(void) /* Ensure that firstcolumn is the starting column of its chunk. */ ensure_firstcolumn_is_aligned(); -#ifdef USE_SLANG - /* Slang curses emulation brain damage, part 1: If we just do what - * curses does here, it'll only work properly if the resize made the - * window smaller. Do what mutt does: Leave and immediately reenter - * Slang screen management mode. */ - SLsmg_reset_smg(); - SLsmg_init_smg(); -#else /* Do the equivalent of what Minimum Profit does: leave and immediately * reenter curses mode. */ endwin(); doupdate(); -#endif /* Put the terminal in the desired state again, recreate the subwindows * with their (new) sizes, and redraw the contents of these windows. */ diff --git a/src/winio.c b/src/winio.c index 423cd56b..caccaf2c 100644 --- a/src/winio.c +++ b/src/winio.c @@ -173,9 +173,6 @@ void run_macro(void) * in the keystroke buffer. */ void read_keys_from(WINDOW *win) { -#if defined(USE_SLANG) && !defined(NANO_TINY) - bool skip_others = FALSE; -#endif int input = ERR; size_t errcount = 0; @@ -196,11 +193,7 @@ void read_keys_from(WINDOW *win) #ifndef NANO_TINY if (the_window_resized) { regenerate_screen(); -#ifdef USE_SLANG - skip_others = TRUE; -#else input = KEY_WINCH; -#endif } #endif if (input == ERR && !waiting_mode) { @@ -227,10 +220,6 @@ void read_keys_from(WINDOW *win) /* If we got a SIGWINCH, get out as the win argument is no longer valid. */ if (input == KEY_WINCH) return; -#ifdef USE_SLANG - if (skip_others) - return; -#endif #endif /* Read in the remaining characters using non-blocking input. */