Commit e55227f6 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: unabbreviate two variable names

parent b77b54bf
Showing with 45 additions and 42 deletions
+45 -42
...@@ -1630,7 +1630,7 @@ int do_input(bool allow_funcs) ...@@ -1630,7 +1630,7 @@ int do_input(bool allow_funcs)
/* The length of the input buffer. */ /* The length of the input buffer. */
bool retain_cuts = FALSE; bool retain_cuts = FALSE;
/* Whether to conserve the current contents of the cutbuffer. */ /* Whether to conserve the current contents of the cutbuffer. */
const sc *s; const sc *shortcut;
/* Read in a keystroke, and show the cursor while waiting. */ /* Read in a keystroke, and show the cursor while waiting. */
input = get_kbinput(edit, VISIBLE); input = get_kbinput(edit, VISIBLE);
...@@ -1654,11 +1654,11 @@ int do_input(bool allow_funcs) ...@@ -1654,11 +1654,11 @@ int do_input(bool allow_funcs)
#endif #endif
/* Check for a shortcut in the main list. */ /* Check for a shortcut in the main list. */
s = get_shortcut(&input); shortcut = get_shortcut(&input);
/* If we got a non-high-bit control key, a meta key sequence, or a /* If we got a non-high-bit control key, a meta key sequence, or a
* function key, and it's not a shortcut or toggle, throw it out. */ * function key, and it's not a shortcut or toggle, throw it out. */
if (s == NULL) { if (shortcut == NULL) {
if (is_ascii_cntrl_char(input) || meta_key || !is_byte(input)) { if (is_ascii_cntrl_char(input) || meta_key || !is_byte(input)) {
unbound_key(input); unbound_key(input);
input = ERR; input = ERR;
...@@ -1671,7 +1671,7 @@ int do_input(bool allow_funcs) ...@@ -1671,7 +1671,7 @@ int do_input(bool allow_funcs)
/* If the keystroke isn't a shortcut nor a toggle, it's a normal text /* If the keystroke isn't a shortcut nor a toggle, it's a normal text
* character: add the character to the input buffer -- or display a * character: add the character to the input buffer -- or display a
* warning when we're in view mode. */ * warning when we're in view mode. */
if (input != ERR && s == NULL) { if (input != ERR && shortcut == NULL) {
if (ISSET(VIEW_MODE)) if (ISSET(VIEW_MODE))
print_view_warning(); print_view_warning();
else { else {
...@@ -1691,7 +1691,7 @@ int do_input(bool allow_funcs) ...@@ -1691,7 +1691,7 @@ int do_input(bool allow_funcs)
* characters waiting after the one we read in, we need to output * characters waiting after the one we read in, we need to output
* all available characters in the input puddle. Note that this * all available characters in the input puddle. Note that this
* puddle will be empty if we're in view mode. */ * puddle will be empty if we're in view mode. */
if (s || get_key_buffer_len() == 0) { if (shortcut || get_key_buffer_len() == 0) {
if (puddle != NULL) { if (puddle != NULL) {
/* Insert all bytes in the input buffer into the edit buffer /* Insert all bytes in the input buffer into the edit buffer
* at once, filtering out any low control codes. */ * at once, filtering out any low control codes. */
...@@ -1705,10 +1705,10 @@ int do_input(bool allow_funcs) ...@@ -1705,10 +1705,10 @@ int do_input(bool allow_funcs)
} }
} }
if (s == NULL) if (shortcut == NULL)
pletion_line = NULL; pletion_line = NULL;
else { else {
const subnfunc *f = sctofunc(s); const subnfunc *f = sctofunc(shortcut);
if (ISSET(VIEW_MODE) && f && !f->viewok) { if (ISSET(VIEW_MODE) && f && !f->viewok) {
print_view_warning(); print_view_warning();
...@@ -1717,21 +1717,22 @@ int do_input(bool allow_funcs) ...@@ -1717,21 +1717,22 @@ int do_input(bool allow_funcs)
/* If the function associated with this shortcut is /* If the function associated with this shortcut is
* cutting or copying text, remember this. */ * cutting or copying text, remember this. */
if (s->scfunc == do_cut_text_void if (shortcut->scfunc == do_cut_text_void
#ifndef NANO_TINY #ifndef NANO_TINY
|| s->scfunc == do_copy_text || s->scfunc == do_cut_till_eof || shortcut->scfunc == do_copy_text
|| shortcut->scfunc == do_cut_till_eof
#endif #endif
) )
retain_cuts = TRUE; retain_cuts = TRUE;
#ifdef ENABLE_WORDCOMPLETION #ifdef ENABLE_WORDCOMPLETION
if (s->scfunc != complete_a_word) if (shortcut->scfunc != complete_a_word)
pletion_line = NULL; pletion_line = NULL;
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
if (s->scfunc == do_toggle_void) { if (shortcut->scfunc == do_toggle_void) {
do_toggle(s->toggle); do_toggle(shortcut->toggle);
if (s->toggle != CUT_FROM_CURSOR) if (shortcut->toggle != CUT_FROM_CURSOR)
retain_cuts = TRUE; retain_cuts = TRUE;
} else } else
#endif #endif
...@@ -1751,7 +1752,7 @@ int do_input(bool allow_funcs) ...@@ -1751,7 +1752,7 @@ int do_input(bool allow_funcs)
} }
#endif #endif
/* Execute the function of the shortcut. */ /* Execute the function of the shortcut. */
execute(s); execute(shortcut);
#ifndef NANO_TINY #ifndef NANO_TINY
/* When the marked region changes without Shift being held, /* When the marked region changes without Shift being held,
...@@ -1770,14 +1771,16 @@ int do_input(bool allow_funcs) ...@@ -1770,14 +1771,16 @@ int do_input(bool allow_funcs)
/* If the cursor moved to another line and this was not caused /* If the cursor moved to another line and this was not caused
* by adding characters to the buffer, clear the prepend flag. */ * by adding characters to the buffer, clear the prepend flag. */
if (openfile->current->next != was_next && if (openfile->current->next != was_next &&
s->scfunc != do_tab && s->scfunc != do_verbatim_input) shortcut->scfunc != do_tab &&
shortcut->scfunc != do_verbatim_input)
wrap_reset(); wrap_reset();
#endif #endif
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
if (f && !f->viewok && !refresh_needed) if (f && !f->viewok && !refresh_needed)
check_the_multis(openfile->current); check_the_multis(openfile->current);
#endif #endif
if (!refresh_needed && (s->scfunc == do_delete || s->scfunc == do_backspace)) if (!refresh_needed && (shortcut->scfunc == do_delete ||
shortcut->scfunc == do_backspace))
update_line(openfile->current, openfile->current_x); update_line(openfile->current, openfile->current_x);
} }
} }
......
...@@ -64,7 +64,7 @@ int do_statusbar_input(bool *ran_func, bool *finished) ...@@ -64,7 +64,7 @@ int do_statusbar_input(bool *ran_func, bool *finished)
/* The input buffer. */ /* The input buffer. */
static size_t kbinput_len = 0; static size_t kbinput_len = 0;
/* The length of the input buffer. */ /* The length of the input buffer. */
const sc *s; const sc *shortcut;
const subnfunc *f; const subnfunc *f;
*ran_func = FALSE; *ran_func = FALSE;
...@@ -90,11 +90,11 @@ int do_statusbar_input(bool *ran_func, bool *finished) ...@@ -90,11 +90,11 @@ int do_statusbar_input(bool *ran_func, bool *finished)
#endif #endif
/* Check for a shortcut in the current list. */ /* Check for a shortcut in the current list. */
s = get_shortcut(&input); shortcut = get_shortcut(&input);
/* If we got a non-high-bit control key, a meta key sequence, or a /* If we got a non-high-bit control key, a meta key sequence, or a
* function key, and it's not a shortcut or toggle, throw it out. */ * function key, and it's not a shortcut or toggle, throw it out. */
if (s == NULL) { if (shortcut == NULL) {
if (is_ascii_cntrl_char(input) || meta_key || !is_byte(input)) { if (is_ascii_cntrl_char(input) || meta_key || !is_byte(input)) {
beep(); beep();
input = ERR; input = ERR;
...@@ -103,7 +103,7 @@ int do_statusbar_input(bool *ran_func, bool *finished) ...@@ -103,7 +103,7 @@ int do_statusbar_input(bool *ran_func, bool *finished)
/* If the keystroke isn't a shortcut nor a toggle, it's a normal text /* If the keystroke isn't a shortcut nor a toggle, it's a normal text
* character: add the it to the input buffer, when allowed. */ * character: add the it to the input buffer, when allowed. */
if (input != ERR && s == NULL) { if (input != ERR && shortcut == NULL) {
/* Only accept input when not in restricted mode, or when not at /* Only accept input when not in restricted mode, or when not at
* the "Write File" prompt, or when there is no filename yet. */ * the "Write File" prompt, or when there is no filename yet. */
if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE || if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE ||
...@@ -117,7 +117,7 @@ int do_statusbar_input(bool *ran_func, bool *finished) ...@@ -117,7 +117,7 @@ int do_statusbar_input(bool *ran_func, bool *finished)
/* If we got a shortcut, or if there aren't any other keystrokes waiting /* If we got a shortcut, or if there aren't any other keystrokes waiting
* after the one we read in, we need to insert all the characters in the * after the one we read in, we need to insert all the characters in the
* input buffer (if not empty) into the answer. */ * input buffer (if not empty) into the answer. */
if ((s || get_key_buffer_len() == 0) && kbinput != NULL) { if ((shortcut || get_key_buffer_len() == 0) && kbinput != NULL) {
/* Inject all characters in the input buffer at once, filtering out /* Inject all characters in the input buffer at once, filtering out
* control characters. */ * control characters. */
do_statusbar_output(kbinput, kbinput_len, TRUE); do_statusbar_output(kbinput, kbinput_len, TRUE);
...@@ -128,42 +128,42 @@ int do_statusbar_input(bool *ran_func, bool *finished) ...@@ -128,42 +128,42 @@ int do_statusbar_input(bool *ran_func, bool *finished)
kbinput = NULL; kbinput = NULL;
} }
if (s) { if (shortcut) {
if (s->scfunc == do_tab || s->scfunc == do_enter) if (shortcut->scfunc == do_tab || shortcut->scfunc == do_enter)
; ;
else if (s->scfunc == do_left) else if (shortcut->scfunc == do_left)
do_statusbar_left(); do_statusbar_left();
else if (s->scfunc == do_right) else if (shortcut->scfunc == do_right)
do_statusbar_right(); do_statusbar_right();
#ifndef NANO_TINY #ifndef NANO_TINY
else if (s->scfunc == do_prev_word_void) else if (shortcut->scfunc == do_prev_word_void)
do_statusbar_prev_word(); do_statusbar_prev_word();
else if (s->scfunc == do_next_word_void) else if (shortcut->scfunc == do_next_word_void)
do_statusbar_next_word(); do_statusbar_next_word();
#endif #endif
else if (s->scfunc == do_home) else if (shortcut->scfunc == do_home)
do_statusbar_home(); do_statusbar_home();
else if (s->scfunc == do_end) else if (shortcut->scfunc == do_end)
do_statusbar_end(); do_statusbar_end();
/* When in restricted mode at the "Write File" prompt and the /* When in restricted mode at the "Write File" prompt and the
* filename isn't blank, disallow any input and deletion. */ * filename isn't blank, disallow any input and deletion. */
else if (ISSET(RESTRICTED) && currmenu == MWRITEFILE && else if (ISSET(RESTRICTED) && currmenu == MWRITEFILE &&
openfile->filename[0] != '\0' && openfile->filename[0] != '\0' &&
(s->scfunc == do_verbatim_input || (shortcut->scfunc == do_verbatim_input ||
s->scfunc == do_cut_text_void || shortcut->scfunc == do_cut_text_void ||
s->scfunc == do_uncut_text || shortcut->scfunc == do_uncut_text ||
s->scfunc == do_delete || shortcut->scfunc == do_delete ||
s->scfunc == do_backspace)) shortcut->scfunc == do_backspace))
; ;
else if (s->scfunc == do_verbatim_input) else if (shortcut->scfunc == do_verbatim_input)
do_statusbar_verbatim_input(); do_statusbar_verbatim_input();
else if (s->scfunc == do_cut_text_void) else if (shortcut->scfunc == do_cut_text_void)
do_statusbar_cut_text(); do_statusbar_cut_text();
else if (s->scfunc == do_delete) else if (shortcut->scfunc == do_delete)
do_statusbar_delete(); do_statusbar_delete();
else if (s->scfunc == do_backspace) else if (shortcut->scfunc == do_backspace)
do_statusbar_backspace(); do_statusbar_backspace();
else if (s->scfunc == do_uncut_text) { else if (shortcut->scfunc == do_uncut_text) {
if (cutbuffer != NULL) if (cutbuffer != NULL)
do_statusbar_uncut_text(); do_statusbar_uncut_text();
} else { } else {
...@@ -171,12 +171,12 @@ int do_statusbar_input(bool *ran_func, bool *finished) ...@@ -171,12 +171,12 @@ int do_statusbar_input(bool *ran_func, bool *finished)
* ran_func to TRUE if we try to run their associated functions, * ran_func to TRUE if we try to run their associated functions,
* and setting finished to TRUE to indicatethat we're done after * and setting finished to TRUE to indicatethat we're done after
* running or trying to run their associated functions. */ * running or trying to run their associated functions. */
f = sctofunc(s); f = sctofunc(shortcut);
if (s->scfunc != NULL) { if (shortcut->scfunc != NULL) {
*ran_func = TRUE; *ran_func = TRUE;
if (f && (!ISSET(VIEW_MODE) || f->viewok) && if (f && (!ISSET(VIEW_MODE) || f->viewok) &&
f->scfunc != do_gotolinecolumn_void) f->scfunc != do_gotolinecolumn_void)
execute(s); execute(shortcut);
} }
*finished = TRUE; *finished = TRUE;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment