mirror of git://git.sv.gnu.org/nano.git
tweaks: rename a symbol, away from an obscure abbreviation
Also, reshuffle its definition, and change its value to match other special codes.
This commit is contained in:
parent
887803cb67
commit
c53839cefa
|
@ -498,11 +498,11 @@ char *browse(char *path)
|
|||
#ifndef NANO_TINY
|
||||
/* Simulate a terminal resize to force a directory reread,
|
||||
* or because the terminal dimensions might have changed. */
|
||||
kbinput = KEY_WINCH;
|
||||
kbinput = THE_WINDOW_RESIZED;
|
||||
} else if (function == do_toggle && get_shortcut(kbinput)->toggle == NO_HELP) {
|
||||
TOGGLE(NO_HELP);
|
||||
window_init();
|
||||
kbinput = KEY_WINCH;
|
||||
kbinput = THE_WINDOW_RESIZED;
|
||||
#endif
|
||||
} else if (function == do_search_backward) {
|
||||
search_filename(BACKWARD);
|
||||
|
@ -642,7 +642,7 @@ char *browse(char *path)
|
|||
implant(first_sc_for(MBROWSER, function)->expansion);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
} else if (kbinput == KEY_WINCH) {
|
||||
} else if (kbinput == THE_WINDOW_RESIZED) {
|
||||
; /* Gets handled below. */
|
||||
#endif
|
||||
} else if (function == do_exit) {
|
||||
|
@ -652,7 +652,7 @@ char *browse(char *path)
|
|||
|
||||
#ifndef NANO_TINY
|
||||
/* If the terminal resized (or might have), refresh the file list. */
|
||||
if (kbinput == KEY_WINCH) {
|
||||
if (kbinput == THE_WINDOW_RESIZED) {
|
||||
/* Remember the selected file, to be able to reselect it. */
|
||||
present_name = copy_of(filelist[selected]);
|
||||
goto read_directory_contents;
|
||||
|
|
|
@ -227,9 +227,14 @@
|
|||
#define PLANTED_A_COMMAND 0x4EC
|
||||
#define NO_SUCH_FUNCTION 0x4EF
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* A special keycode for Ctrl + the central key on the numeric keypad. */
|
||||
#define KEY_CENTER 0x4F0
|
||||
|
||||
/* A special keycode for when we get a SIGWINCH (a window resize). */
|
||||
#define THE_WINDOW_RESIZED 0x4F7
|
||||
#endif
|
||||
|
||||
/* A special keycode to signal the beginning and end of a bracketed paste. */
|
||||
#define BRACKETED_PASTE_MARKER 0x4FB
|
||||
|
||||
|
@ -240,9 +245,6 @@
|
|||
#define KEY_FRESH 0x4FE
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* A special keycode for when we get a SIGWINCH (a window resize). */
|
||||
#define KEY_WINCH -2
|
||||
|
||||
/* Some extra flags for the undo function. */
|
||||
#define WAS_BACKSPACE_AT_EOF (1<<1)
|
||||
#define WAS_WHOLE_LINE (1<<2)
|
||||
|
|
|
@ -513,7 +513,7 @@ void show_help(void)
|
|||
get_mouseinput(&dummy_row, &dummy_col, TRUE);
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
} else if (kbinput == KEY_WINCH) {
|
||||
} else if (kbinput == THE_WINDOW_RESIZED) {
|
||||
; /* Nothing to do. */
|
||||
#endif
|
||||
} else if (function == do_exit) {
|
||||
|
|
|
@ -1592,7 +1592,7 @@ void process_a_keystroke(void)
|
|||
lastmessage = VACUUM;
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (input == KEY_WINCH)
|
||||
if (input == THE_WINDOW_RESIZED)
|
||||
return;
|
||||
#endif
|
||||
#ifdef ENABLE_MOUSE
|
||||
|
|
|
@ -442,9 +442,9 @@ functionptrtype acquire_an_answer(int *actual, bool *listed,
|
|||
|
||||
#ifndef NANO_TINY
|
||||
/* If the window size changed, go reformat the prompt string. */
|
||||
if (input == KEY_WINCH) {
|
||||
if (input == THE_WINDOW_RESIZED) {
|
||||
refresh_func(); /* Only needed when in file browser. */
|
||||
*actual = KEY_WINCH;
|
||||
*actual = THE_WINDOW_RESIZED;
|
||||
#ifdef ENABLE_HISTORIES
|
||||
free(stored_string);
|
||||
#endif
|
||||
|
@ -598,7 +598,7 @@ int do_prompt(int menu, const char *provided, linestruct **history_list,
|
|||
free(prompt);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (retval == KEY_WINCH)
|
||||
if (retval == THE_WINDOW_RESIZED)
|
||||
goto redo_theprompt;
|
||||
#endif
|
||||
|
||||
|
@ -697,7 +697,7 @@ int ask_user(bool withall, const char *question)
|
|||
kbinput = get_kbinput(footwin, !withall);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (kbinput == KEY_WINCH)
|
||||
if (kbinput == THE_WINDOW_RESIZED)
|
||||
continue;
|
||||
|
||||
/* Accept first character of an external paste and ignore the rest. */
|
||||
|
|
|
@ -2877,7 +2877,7 @@ void do_linter(void)
|
|||
kbinput = get_kbinput(footwin, VISIBLE);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (kbinput == KEY_WINCH)
|
||||
if (kbinput == THE_WINDOW_RESIZED)
|
||||
continue;
|
||||
#endif
|
||||
function = func_from_key(kbinput);
|
||||
|
|
|
@ -218,7 +218,7 @@ void read_keys_from(WINDOW *frame)
|
|||
#ifndef NANO_TINY
|
||||
if (the_window_resized) {
|
||||
regenerate_screen();
|
||||
input = KEY_WINCH;
|
||||
input = THE_WINDOW_RESIZED;
|
||||
}
|
||||
|
||||
if (timed) {
|
||||
|
@ -272,7 +272,7 @@ void read_keys_from(WINDOW *frame)
|
|||
}
|
||||
|
||||
/* If we got a SIGWINCH, get out as the frame argument is no longer valid. */
|
||||
if (input == KEY_WINCH)
|
||||
if (input == THE_WINDOW_RESIZED)
|
||||
return;
|
||||
|
||||
/* Remember where the recording of this keystroke (or burst of them) started. */
|
||||
|
@ -1445,7 +1445,7 @@ int *parse_verbatim_kbinput(WINDOW *frame, size_t *count)
|
|||
|
||||
#ifndef NANO_TINY
|
||||
/* When the window was resized, abort and return nothing. */
|
||||
if (keycode == KEY_WINCH) {
|
||||
if (keycode == THE_WINDOW_RESIZED) {
|
||||
*count = 999;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1469,7 +1469,7 @@ int *parse_verbatim_kbinput(WINDOW *frame, size_t *count)
|
|||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (keycode == KEY_WINCH) {
|
||||
if (keycode == THE_WINDOW_RESIZED) {
|
||||
*count = 999;
|
||||
free(yield);
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue