commit 1be0285832f361e8203e02f91c429e240e28d8ee
parent 2867f1bbdebf2c8bf6fe5b4307b686b12e09b180
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 3 Jan 2020 12:00:06 +0100
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.
Diffstat:
2 files changed, 1 insertion(+), 21 deletions(-)
diff --git 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
@@ -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. */