From: Christian Heller Date: Tue, 21 Oct 2025 13:41:11 +0000 (+0200) Subject: Also update status line after each successful command execution. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/%7B%7Btodo.comment%7D%7D?a=commitdiff_plain;ds=inline;p=ircplom Also update status line after each successful command execution. --- diff --git a/src/ircplom/tui_base.py b/src/ircplom/tui_base.py index 27eea95..4b2cf9d 100644 --- a/src/ircplom/tui_base.py +++ b/src/ircplom/tui_base.py @@ -695,6 +695,7 @@ class BaseTui(QueueMixin): + f'(given {len(toks)}, need {n_args_min})' else: alert = cmd(*toks) + self._status_line.taint() else: alert = 'not prefixed by /' if alert: diff --git a/src/tests/tui_draw.test b/src/tests/tui_draw.test index 2eba2f7..f259ffc 100644 --- a/src/tests/tui_draw.test +++ b/src/tests/tui_draw.test @@ -19,13 +19,13 @@ repeat lines-empty-4 +12 | lines-empty-16-out repeat lines-empty-4 +16 repeat lines-empty-2 +20 -| status-[0]-prompt-empty-in +| status-[0]-prompt-in line 22 on_black,bright_white :start)=====================================================================([0]§§ | prompt-empty-in line 23 on_black,bright_white > § §§ line 23 on_black,bright_white,reverse §§ § | prompt-empty-out -| status-[0]-prompt-empty-out +| status-[0]-prompt-out | empty-init-out # nothing happening on empty command input @@ -52,7 +52,7 @@ line 20 on_black,bright_white 20§§-§§-§§ §§ line 21 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: not prefixed by / §§ | history-lines-0:1:2-out | history-lines-0:0:2-out -repeat status-[0]-prompt-empty +repeat status-[0]-prompt | with-only-2-lines-history-out # check scrolling on history merely 2 lines long won't do anything either @@ -72,7 +72,7 @@ repeat history-lines-0:0:2 +19 | history-lines-0:2:3-in line 21 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /foo unknown §§ | history-lines-0:2:3-out -repeat status-[0]-prompt-empty +repeat status-[0]-prompt | before-first-scroll-out # check scrolling up does something on history 3 lines long @@ -83,7 +83,7 @@ repeat lines-empty-4 +16 repeat history-lines-0:0:1 +20 | topmost-scroll-out line 21 on_black,bright_white,reverse vvv [2] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-[0]-prompt-empty +repeat status-[0]-prompt # check scrolling down on 3-lines history > /window.history.scroll down @@ -103,7 +103,7 @@ repeat before-first-scroll > /window.history.scroll up repeat topmost-scroll +0 line 21 on_black,bright_white,reverse vvv [2] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-[0]-prompt-empty +repeat status-[0]-prompt > /help log 0 #.. commands available in this window: log 0 #.. /connect HOST_PORT [NICKNAME_PW] [REALNAME_USERNAME] @@ -120,11 +120,9 @@ log 0 #.. /window.prompt.scroll DIRECTION | before-scrolldown-not-to-bottom-in repeat topmost-scroll line 21 on_black,bright_white,reverse vvv [14] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -| status-[0:12]-prompt-in +| before-scrolldown-not-to-bottom-out line 22 on_black,bright_white :start)================================================================([(0:12)]§§ repeat prompt-empty -| status-[0:12]-prompt-out -| before-scrolldown-not-to-bottom-out # check scroll-down on newer history longer than half a screen width does not fully land at bottom > /window.history.scroll down @@ -159,12 +157,16 @@ line 20 on_black,bright_cyan #.. §§:§§:§§ /window.paste | history-lines-0:10:12-out | history-lines-0:8:12-out line 21 on_black,bright_white,reverse vvv [3] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-[0:12]-prompt +| status-[0:3]-prompt-in +line 22 on_black,bright_white :start)=================================================================([(0:3)]§§ +repeat prompt-empty +| status-[0:3]-prompt-out | after-scrolldown-not-to-bottom-out # check previous scroll-down not hitting bottom be fully reversible > /window.history.scroll up repeat before-scrolldown-not-to-bottom +repeat status-[0:3]-prompt > /window.history.scroll down repeat after-scrolldown-not-to-bottom @@ -182,7 +184,7 @@ line 20 on_black,bright_cyan #.. §§:§§:§§ /window.prompt.move_cursor DIR | history-lines-0:14:15-in line 21 on_black,bright_cyan #.. §§:§§:§§ /window.prompt.scroll DIRECTION§§ | history-lines-0:14:15-out -repeat status-[0:12]-prompt +repeat status-[0]-prompt > /0 log 0 #!. invalid prompt command: /0 unknown > /1 @@ -226,7 +228,7 @@ line 20 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /6 u | history-lines-0:22:23-in line 21 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /7 unknown§§ | history-lines-0:22:23-out -repeat status-[0]-prompt-empty +repeat status-[0]-prompt | at-bottom-before-wrapped-out # check scroll-down even with long history does nothing @@ -240,7 +242,7 @@ repeat lines-empty-1 +8 repeat history-lines-0:0:8 +9 repeat history-lines-0:8:12 +17 line 21 on_black,bright_white,reverse vvv [11] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-[0]-prompt-empty +repeat status-[0]-prompt > /window.history.scroll down repeat at-bottom-before-wrapped @@ -262,7 +264,7 @@ line 19 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /foo line 20 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /foo_0123456789_0123456789_012345678§§ line 21 on_black,bright_red,bold unknown§§ | history-lines-0:24:26-out -repeat status-[0]-prompt-empty +repeat status-[0]-prompt | at-bottom-after-wrapped-out # check scroll-up over wrapped moves up less history lines than screen lines @@ -276,7 +278,7 @@ repeat history-lines-0:12:14 +18 repeat history-lines-0:14:15 +20 | scrollup-after-wrapped-out line 21 on_black,bright_white,reverse vvv [10] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-[0]-prompt-empty +repeat status-[0]-prompt # check scroll-down fully reversible even if over wrapped > /window.history.scroll down @@ -284,7 +286,7 @@ repeat at-bottom-after-wrapped > /window.history.scroll up repeat scrollup-after-wrapped line 21 on_black,bright_white,reverse vvv [10] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-[0]-prompt-empty +repeat status-[0]-prompt # check wrapped input only increases below-scroll count by one > /bar_0123456789_0123456789_012345678 @@ -448,7 +450,8 @@ line 19 on_black,bright_white -------------------------------------------------- line 20 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /bar_0123456789_0123456789_012345678§§ line 21 on_black,bright_red,bold unknown§§ | history-lines-0:26:28-out -repeat status-[0:1]-1-prompt +repeat status-[0]-1-prompt +repeat status-[0]-1-prompt | first-sight-of-bookmark-out # check that scrolling non-bottom bookmark out of sight, then scrolling it back into view again does not by itself move its position in the log history @@ -459,7 +462,7 @@ repeat history-lines-0:0:8 +3 repeat history-lines-0:8:16 +11 repeat history-lines-0:16:18 +19 line 21 on_black,bright_white,reverse vvv [8] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-[0:1]-1-prompt +repeat status-[0]-1-prompt > /window.history.scroll down repeat first-sight-of-bookmark @@ -655,7 +658,7 @@ line 18 on_black,bright_white <.. §§:§§:§§ PING :bar line 19 on_black,bright_green >.. §§:§§:§§ PONG :bar line 20 on_black,bright_white <.. §§:§§:§§ PING :baz line 21 on_black,bright_green >.. §§:§§:§§ PONG :baz -repeat status-0-[1:6]-prompt +repeat status-0-[1]-prompt > /quit log 0 <..