diff -uNr a/yrc/codemap.txt b/yrc/codemap.txt --- a/yrc/codemap.txt 770974cfdcc65af191d32cd4929febd6cb1e01d181307746c8a00cb8638af6e468db987916661af1112870c6e810d4fcb93ddf5020fd486d87c2145afb979b29 +++ b/yrc/codemap.txt e17fe3855e0266ce8a34fcd51a3c38da6ef09219e932222ee8e844a40ec1e218796f8be809eb442dc0cf0c9246ad389c6806d6ee424fdf8c77deb7d1627c530b @@ -209,9 +209,9 @@ get_buf(name, parent_name) -> buf : buffer_index lookup but creates if not found close_buf(buf) prompt_insert(chr) -prompt_delete -prompt_backspace prompt_submit +prompt_backspace +prompt_delete info(msg: str, buf=None) : buf_log_msg to buf or buffers[0] error(msg_or_exc: str | Exception, buf=None) : buf_log_msg to buf or buffers[0] kaccum(str) diff -uNr a/yrc/manifest b/yrc/manifest --- a/yrc/manifest 8ad4a90cf4bb0fa513b82afdb1149f6c16e3d183531f1992c8e1df8a9e81978c83d65beeb63bc4748b0dfced29d85c00fa64835e5f7f8ba5de3814d5574b0ca5 +++ b/yrc/manifest 562aeaf072a99dfa4950c8215b3a74da57a2d743d4bcc1a25d51a8c85f4b22e1c3c1d705a5cead9b97e232dcb701251b05b18b27bd4e8667505ca3d63396e4ec @@ -1,3 +1,4 @@ 632836 yrc_subdir_genesis jfw Initial V release of yrc, version 97K (regrind of yrc_genesis to follow the project subdir and manifest naming conventions and indent with tabs rather than spaces) 633652 yrc_linear_scroll_etc jfw Version 96K with smooth/linear scrolling, Python 2.6 compat, yrc2local log formatter, bugfixes and more: see NEWS for details. 768770 yrc_minor_refactors_reorders jfw Move prompt_clear to a higher layer by making it use the prompt_chars accessor: it now deletes entries from a fixed character list container rather than replacing the list as a whole. Expand prompt_backspace not to stack on top of prompt_delete, coming out only slightly longer. Tighten some prompt commands (such as backspace/delete) to skip unnecessary redraw. In codemap.txt, reclassify commands dict as a quasiconstant since it doesn't change after startup. +768773 yrc_minor_command_reorder jfw Move prompt_backspace and prompt_delete implementations to match the more sensible order in keymap and manual. diff -uNr a/yrc/yrc.py b/yrc/yrc.py --- a/yrc/yrc.py 8676ae2cd7fae54dd7f6c06ba6e08235dadd31de4b10459bdb03a1e54a7deb35c26dc0108cd0e3228d465fb0899e67e9d4b282ff0677253734fc5f81dcab9aa2 +++ b/yrc/yrc.py 40e09cc21c0e83b9dd8610577fe63c82f5bca1b384e0a37dd791482081f4ecc30efcd2eb9a706e2bb954e0d99bc77e6d115b34696aa2506854b941c22066f052 @@ -833,22 +833,6 @@ prompt_chars().insert(c, char) prompt_set_cursor(c + 1) -@command('prompt-delete') -def prompt_delete(): - c = prompt_cursor() - chars = prompt_chars() - if c < len(chars): - chars.pop(c) - schedule_prompt_draw() - -@command('prompt-backspace') -def prompt_backspace(): - c = prompt_cursor() - 1 - if c >= 0: - prompt_set_cursor(c) - prompt_chars().pop(c) - schedule_prompt_draw() - @command('prompt-submit') def prompt_submit(): line = ''.join(prompt_chars()) @@ -873,6 +857,22 @@ command('prompt-start')(lambda: prompt_set_cursor(0)) command('prompt-end')(lambda: prompt_set_cursor(len(prompt_chars()))) +@command('prompt-backspace') +def prompt_backspace(): + c = prompt_cursor() - 1 + if c >= 0: + prompt_set_cursor(c) + prompt_chars().pop(c) + schedule_prompt_draw() + +@command('prompt-delete') +def prompt_delete(): + c = prompt_cursor() + chars = prompt_chars() + if c < len(chars): + chars.pop(c) + schedule_prompt_draw() + def prompt_draw(): if scr_height < 1: return