nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit bd1fcc5fe20912221e220795d1bdce6e6d13d7b4
parent 370406bb4150b07294b257ec320d6e1ee0d39f3a
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sat,  6 Aug 2016 12:15:03 +0200

tweaks: correct one comment, and adjust another

Diffstat:
Msrc/prompt.c | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/prompt.c b/src/prompt.c @@ -90,15 +90,13 @@ int do_statusbar_input(bool *ran_func, bool *finished, } } - /* If we got a character, and it isn't a shortcut or toggle, - * it's a normal text character. Display the warning if we're - * in view mode, or add the character to the input buffer if - * we're not. */ + /* 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. */ if (input != ERR && !have_shortcut) { - /* If we're using restricted mode, the filename isn't blank, - * and we're at the "Write File" prompt, disable text input. */ - if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' || - currmenu != MWRITEFILE) { + /* Only accept input when not in restricted mode, or when not at + * the "Write File" prompt, or when there is no filename yet. */ + if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE || + openfile->filename[0] == '\0') { kbinput_len++; kbinput = (int *)nrealloc(kbinput, kbinput_len * sizeof(int)); kbinput[kbinput_len - 1] = input;