diff -uNr a/yrc/NEWS b/yrc/NEWS --- a/yrc/NEWS ed9fe6919e2e04f8d92d9aeeb02ff020801215f22e9f3008c125b5b23e9c0ce839714c2bc771c44481f0458b953f42d944086518d1fb666729cafa9dd2da5ad4 +++ b/yrc/NEWS 7def323a816176f98baaa5657c2e8959b5cc3c72f86803e117bb7d2926008bcee2d1f83725bbacd66122ec4692459a5c40fa1ec805bd1e1c33cbde00fe7b7290 @@ -1,4 +1,4 @@ -95K (2022-12-14) +95K (2023-01-01) ================ New features: diff -uNr a/yrc/manifest b/yrc/manifest --- a/yrc/manifest a10d83b0b6067ad83769cf2d79de1e06d71c2931655c1fcb9e524e75b7b3a7b74bd9fd2040fcc10e44bdd13367cc68dda5593d9f6125943d6eedb2b8a20e4ae0 +++ b/yrc/manifest 16e6df019aa8267b0b90b3d0d38b48a597ca27bfe21d8aaede6dd305db9ba5dda08e24bf2fac51fc6beea0160a769fae094fd1026e82be4d38178f60a0a04c91 @@ -14,3 +14,4 @@ 769940 yrc_connect_join_streamlining jfw Switch to network window on connect and channel window on join. Remove self-generated join/part info messages which route distractingly to the network window (the more useful server confirmations still show in the channel's own window and log). Send a new USER command when changing nick in the connected-unregistered state, since I found it necessary for multiple server implementations when nick is in use. 769941 yrc_95K_rc1 Release candidate: catch up on codemap.txt updates, syncing up with the manual; lower temperature (ie bump version numbers) and update NEWS; import my old script for creating deterministic release tarballs, now updated to run on Gales. 769941 yrc_distutils_install_workaround jfw "setup.py install" fails quietly when a pre-existing target .py file has newer timestamp than the source. This was brought to light by the timestamp zeroing of "tar --sterilize" but could arise from other causes too. +769941 yrc_input_fixes jfw Include digits as "word" characters for word-level motions; this should bring them into full agreement with GNU Readline, and closer agreement with pdksh/gksh which also includes underscore. Ensure reset of hscroll when clearing prompt, providing the intended feel when recalling history (cf. yrc_prompt_redraw_optimization). diff -uNr a/yrc/yrc.py b/yrc/yrc.py --- a/yrc/yrc.py 0963718b94a2b9a8e9e8fa120cf1c8f6b3575080eee08b93a362512b9c79e5da22b5bdeedf18e8cccba8884081c016afc9cfff5e474185a6a50814293d047cac +++ b/yrc/yrc.py 68454e3e954e09a56647a63c70eb1867d535c919b7cac991e690f0287b2a4fa01bcacfa4b01d02ed91fa5174ac9e27b05292daa50477240cbe5a469a12eaebac @@ -378,6 +378,7 @@ is_digit = lambda c: '0' <= c <= '9' is_alpha = lambda c: ('a' <= c <= 'z') or ('A' <= c <= 'Z') +is_alnum = lambda c: is_alpha(c) or is_digit(c) def parse_address(addr): addr = addr.rsplit(':', 1) @@ -403,10 +404,10 @@ if i < 0: return start_cursor # Continue until character at cursor is part of a word - while i > 0 and not is_alpha(chars[i]): + while i > 0 and not is_alnum(chars[i]): i -= 1 # Continue until character before cursor is non-word - while i > 0 and is_alpha(chars[i-1]): + while i > 0 and is_alnum(chars[i-1]): i -= 1 return i @@ -416,10 +417,10 @@ if i > len(chars): return start_cursor # Continue until character before cursor is part of a word - while i < len(chars) and not is_alpha(chars[i-1]): + while i < len(chars) and not is_alnum(chars[i-1]): i += 1 # Continue until character at cursor is non-word - while i < len(chars) and is_alpha(chars[i]): + while i < len(chars) and is_alnum(chars[i]): i += 1 return i @@ -932,7 +933,9 @@ schedule_prompt_draw() del prompt_chars()[:] prompt_set_cursor(0) - # hscroll and cursor_column are always updated at drawing time so no need to explicitly reset them, as with any code that changes chars or cursor. + prompt_set_hscroll(0) + # cursor_column is always updated at drawing time so no need to explicitly reset it. + # hscroll is also updated at drawing time if needed, so it would technically be safe to skip too. But if new chars are inserted before the next redraw (such as when recalling input history), the result can differ from what would happen when typing manually. For instance, an old scrolling offset can "stick" even when the new input would fit in full without scrolling. history_ring = new_ring(HISTORY_RING_SIZE) history_pos = None