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.master
parent
2867f1bbde
commit
1be0285832
11
src/nano.c
11
src/nano.c
|
@ -1308,7 +1308,7 @@ void regenerate_screen(void)
|
||||||
|
|
||||||
/* We could check whether COLS or LINES changed, and return otherwise,
|
/* We could check whether COLS or LINES changed, and return otherwise,
|
||||||
* but it seems curses does not always update these global variables. */
|
* 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;
|
COLS = win.ws_col;
|
||||||
LINES = win.ws_row;
|
LINES = win.ws_row;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1317,19 +1317,10 @@ void regenerate_screen(void)
|
||||||
/* Ensure that firstcolumn is the starting column of its chunk. */
|
/* Ensure that firstcolumn is the starting column of its chunk. */
|
||||||
ensure_firstcolumn_is_aligned();
|
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
|
/* Do the equivalent of what Minimum Profit does: leave and immediately
|
||||||
* reenter curses mode. */
|
* reenter curses mode. */
|
||||||
endwin();
|
endwin();
|
||||||
doupdate();
|
doupdate();
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Put the terminal in the desired state again, recreate the subwindows
|
/* Put the terminal in the desired state again, recreate the subwindows
|
||||||
* with their (new) sizes, and redraw the contents of these windows. */
|
* with their (new) sizes, and redraw the contents of these windows. */
|
||||||
|
|
11
src/winio.c
11
src/winio.c
|
@ -173,9 +173,6 @@ void run_macro(void)
|
||||||
* in the keystroke buffer. */
|
* in the keystroke buffer. */
|
||||||
void read_keys_from(WINDOW *win)
|
void read_keys_from(WINDOW *win)
|
||||||
{
|
{
|
||||||
#if defined(USE_SLANG) && !defined(NANO_TINY)
|
|
||||||
bool skip_others = FALSE;
|
|
||||||
#endif
|
|
||||||
int input = ERR;
|
int input = ERR;
|
||||||
size_t errcount = 0;
|
size_t errcount = 0;
|
||||||
|
|
||||||
|
@ -196,11 +193,7 @@ void read_keys_from(WINDOW *win)
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (the_window_resized) {
|
if (the_window_resized) {
|
||||||
regenerate_screen();
|
regenerate_screen();
|
||||||
#ifdef USE_SLANG
|
|
||||||
skip_others = TRUE;
|
|
||||||
#else
|
|
||||||
input = KEY_WINCH;
|
input = KEY_WINCH;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (input == ERR && !waiting_mode) {
|
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 we got a SIGWINCH, get out as the win argument is no longer valid. */
|
||||||
if (input == KEY_WINCH)
|
if (input == KEY_WINCH)
|
||||||
return;
|
return;
|
||||||
#ifdef USE_SLANG
|
|
||||||
if (skip_others)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Read in the remaining characters using non-blocking input. */
|
/* Read in the remaining characters using non-blocking input. */
|
||||||
|
|
Loading…
Reference in New Issue