tweaks: rewrap some lines, drop a redundant call, and reshuffle a line

Six years ago, commit a878f5f1 introduced a call of regenerate_screen()
directly in the input routine, which made the call of refresh_func() in
the prompt routine redundant -- except when in the file browser.
This commit is contained in:
Benno Schulenberg 2022-08-23 10:47:07 +02:00
parent d0dc270eec
commit 7bab8780ad
2 changed files with 7 additions and 10 deletions

View File

@ -1379,9 +1379,8 @@ bool wanted_to_move(void (*func)(void))
/* Return TRUE when the given function makes a change -- no good for view mode. */
bool changes_something(const void *f)
{
return (f == do_savefile || f == do_writeout || f == do_enter ||
f == do_tab || f == do_delete || f == do_backspace ||
f == cut_text || f == paste_text || f == do_replace ||
return (f == do_savefile || f == do_writeout || f == do_enter || f == do_tab ||
f == do_delete || f == do_backspace || f == cut_text || f == paste_text ||
#ifndef NANO_TINY
f == chop_previous_word || f == chop_next_word ||
f == zap_text || f == cut_till_eof || f == do_execute ||
@ -1399,7 +1398,7 @@ bool changes_something(const void *f)
#ifdef ENABLE_WORDCOMPLETION
f == complete_a_word ||
#endif
f == do_verbatim_input);
f == do_replace || f == do_verbatim_input);
}
#ifndef NANO_TINY

View File

@ -442,7 +442,7 @@ 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) {
refresh_func();
refresh_func(); /* Only needed when in file browser. */
*actual = KEY_WINCH;
#ifdef ENABLE_HISTORIES
free(stored_string);
@ -595,20 +595,18 @@ int do_prompt(int menu, const char *provided, linestruct **history_list,
function = acquire_an_answer(&retval, &listed, history_list, refresh_func);
free(prompt);
prompt = saved_prompt;
#ifndef NANO_TINY
if (retval == KEY_WINCH)
goto redo_theprompt;
#endif
/* If we're done with this prompt, restore the x position to what
* it was at a possible previous prompt. */
/* Restore a possible previous prompt and maybe the typing position. */
prompt = saved_prompt;
if (function == do_cancel || function == do_enter)
typing_x = was_typing_x;
/* If we left the prompt via Cancel or Enter, set the return value
* properly. */
/* Set the proper return value for Cancel and Enter. */
if (function == do_cancel)
retval = -1;
else if (function == do_enter)