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

tweaks: elide a parameter that is always TRUE

The parameter was made redundant by David's overhaul of the
justification code.
parent 7e152f2a
Showing with 8 additions and 15 deletions
+8 -15
...@@ -1652,9 +1652,8 @@ bool okay_for_view(const sc *shortcut) ...@@ -1652,9 +1652,8 @@ bool okay_for_view(const sc *shortcut)
} }
/* Read in a keystroke. Act on the keystroke if it is a shortcut or a toggle; /* Read in a keystroke. Act on the keystroke if it is a shortcut or a toggle;
* otherwise, insert it into the edit buffer. If allow_funcs is FALSE, don't * otherwise, insert it into the edit buffer. */
* do anything with the keystroke -- just return it. */ void do_input(void)
int do_input(bool allow_funcs)
{ {
int input; int input;
/* The keystroke we read in: a character or a shortcut. */ /* The keystroke we read in: a character or a shortcut. */
...@@ -1671,7 +1670,7 @@ int do_input(bool allow_funcs) ...@@ -1671,7 +1670,7 @@ int do_input(bool allow_funcs)
#ifndef NANO_TINY #ifndef NANO_TINY
if (input == KEY_WINCH) if (input == KEY_WINCH)
return KEY_WINCH; return;
#endif #endif
#ifdef ENABLE_MOUSE #ifdef ENABLE_MOUSE
...@@ -1683,7 +1682,7 @@ int do_input(bool allow_funcs) ...@@ -1683,7 +1682,7 @@ int do_input(bool allow_funcs)
input = get_kbinput(edit, BLIND); input = get_kbinput(edit, BLIND);
else else
/* The click was invalid or has been handled -- get out. */ /* The click was invalid or has been handled -- get out. */
return ERR; return;
} }
#endif #endif
...@@ -1699,9 +1698,6 @@ int do_input(bool allow_funcs) ...@@ -1699,9 +1698,6 @@ int do_input(bool allow_funcs)
} }
} }
if (!allow_funcs)
return input;
/* 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. */
...@@ -1744,7 +1740,7 @@ int do_input(bool allow_funcs) ...@@ -1744,7 +1740,7 @@ int do_input(bool allow_funcs)
else { else {
if (ISSET(VIEW_MODE) && !okay_for_view(shortcut)) { if (ISSET(VIEW_MODE) && !okay_for_view(shortcut)) {
print_view_warning(); print_view_warning();
return ERR; return;
} }
/* If the function associated with this shortcut is /* If the function associated with this shortcut is
...@@ -1763,7 +1759,7 @@ int do_input(bool allow_funcs) ...@@ -1763,7 +1759,7 @@ int do_input(bool allow_funcs)
#ifdef ENABLE_NANORC #ifdef ENABLE_NANORC
if (shortcut->func == (functionptrtype)implant) { if (shortcut->func == (functionptrtype)implant) {
implant(shortcut->expansion); implant(shortcut->expansion);
return 42; return;
} }
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
...@@ -1828,8 +1824,6 @@ int do_input(bool allow_funcs) ...@@ -1828,8 +1824,6 @@ int do_input(bool allow_funcs)
* blow away the text in the cutbuffer upon the next cutting action. */ * blow away the text in the cutbuffer upon the next cutting action. */
if (!retain_cuts) if (!retain_cuts)
cutbuffer_reset(); cutbuffer_reset();
return input;
} }
/* The user typed output_len multibyte characters. Add them to the edit /* The user typed output_len multibyte characters. Add them to the edit
...@@ -2707,7 +2701,7 @@ int main(int argc, char **argv) ...@@ -2707,7 +2701,7 @@ int main(int argc, char **argv)
/* Forget any earlier cursor position at the prompt. */ /* Forget any earlier cursor position at the prompt. */
put_cursor_at_end_of_answer(); put_cursor_at_end_of_answer();
/* Read in and interpret keystrokes. */ /* Read in and interpret a single keystroke. */
do_input(TRUE); do_input();
} }
} }
...@@ -430,7 +430,6 @@ void confirm_margin(void); ...@@ -430,7 +430,6 @@ void confirm_margin(void);
#endif #endif
void unbound_key(int code); void unbound_key(int code);
bool okay_for_view(const sc *shortcut); bool okay_for_view(const sc *shortcut);
int do_input(bool allow_funcs);
void do_output(char *output, size_t output_len, bool allow_cntrls); void do_output(char *output, size_t output_len, bool allow_cntrls);
/* Most functions in prompt.c. */ /* Most functions in prompt.c. */
......
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