Curses: fix extended command input

The extended command input prompt was behaving in an unintended way:
Typing #a<enter> executed #adjust. Spaces in the entry prevented matching
any command. No error message was given when no command was matched.

Fix all of those, so it behaves more like the tty.

Clean up the tty, curses, and X11 windowport code, so they don't use
the extcmdlist array directly, but query with extcmds_match
and extcmds_getentry.
This commit is contained in:
Pasi Kallinen
2022-01-22 14:32:50 +02:00
parent fe4ae913cc
commit 9d64d135b8
7 changed files with 100 additions and 75 deletions

View File

@@ -18,6 +18,12 @@
#define PREFIXCMD 0x100 /* prefix command, requires another one after it */
#define MOVEMENTCMD 0x200 /* used to move hero/cursor */
/* flags for extcmds_match() */
#define ECM_NOFLAGS 0
#define ECM_IGNOREAC 0x01 /* ignore !autocomplete commands */
#define ECM_EXACTMATCH 0x02 /* needs exact match of findstr */
#define ECM_NO1CHARCMD 0x04 /* ignore commands like '?' and '#' */
struct ext_func_tab {
uchar key;
const char *ef_txt, *ef_desc;