fix(messages): recognize cmdline one_key/number prompt State (#34206)

Problem:  Since 48e2a736, prompt messages are handled by an actual
          active cmdline, resulting in `State` no longer being equal
          to `MODE_CONFIRM` which is used in some places. E.g. to
          specify the current `mode()` or to re-emit a confirm message.
Solution: Replace `MODE_CONFIRM` with a new `MODE_CMDLINE` sub-mode when
          `ccline.one_key/mouse_used` is set. Use it to avoid clearing
          mouse_used prompt messages, and to re-emit one_key messages
          (when ext_messages is inactive, for which this is unnecessary).
This commit is contained in:
luukvbaal
2025-06-09 18:57:28 +02:00
committed by GitHub
parent 2f0fbdaa48
commit e876a739ee
10 changed files with 62 additions and 26 deletions

View File

@@ -41,8 +41,6 @@ int ask_yesno(const char *const str)
const int save_State = State;
no_wait_return++;
State = MODE_CONFIRM; // Mouse behaves like with :confirm.
setmouse(); // Disable mouse in xterm.
snprintf(IObuff, IOSIZE, _("%s (y/n)?"), str);
char *prompt = xstrdup(IObuff);