browser: restore typing position at prompt after "^R name ^T ^F ^V ^C"

When going back from the browser to a file prompt, restore the typing
position also after a 'to_first_file' (^Y) and 'to_last_file (^V).

The cursor misplacement existed since version 5.9, commit 508301a2.
This commit is contained in:
Benno Schulenberg 2024-02-11 15:48:15 +01:00
parent 206b4e2a7e
commit 20692e0c29
1 changed files with 3 additions and 0 deletions

View File

@ -604,6 +604,9 @@ int do_prompt(int menu, const char *provided, linestruct **history_list,
/* Restore a possible previous prompt and maybe the typing position. */
prompt = saved_prompt;
if (function == do_cancel || function == do_enter ||
#ifdef ENABLE_BROWSER
function == to_first_file || function == to_last_file ||
#endif
function == to_first_line || function == to_last_line)
typing_x = was_typing_x;