diff --git a/src/textual/widgets/_input.py b/src/textual/widgets/_input.py index 62f8f81d00..7b1f7a0a98 100644 --- a/src/textual/widgets/_input.py +++ b/src/textual/widgets/_input.py @@ -84,7 +84,12 @@ class Input(ScrollView): "Move cursor left a word and select", show=False, ), - Binding("right", "cursor_right", "Move cursor right", show=False), + Binding( + "right", + "cursor_right", + "Move cursor right or accept the completion suggestion", + show=False, + ), Binding( "shift+right", "cursor_right(True)", @@ -123,18 +128,27 @@ class Input(ScrollView): | Key(s) | Description | | :- | :- | | left | Move the cursor left. | + | shift+left | Move cursor left and select. | | ctrl+left | Move the cursor one word to the left. | | right | Move the cursor right or accept the completion suggestion. | + | ctrl+shift+left | Move cursor left a word and select. | + | shift+right | Move cursor right and select. | | ctrl+right | Move the cursor one word to the right. | | backspace | Delete the character to the left of the cursor. | + | ctrl+shift+right | Move cursor right a word and select. | | home,ctrl+a | Go to the beginning of the input. | | end,ctrl+e | Go to the end of the input. | + | shift+home | Select up to the input start. | + | shift+end | Select up to the input end. | | delete,ctrl+d | Delete the character to the right of the cursor. | | enter | Submit the current value of the input. | | ctrl+w | Delete the word to the left of the cursor. | | ctrl+u | Delete everything to the left of the cursor. | | ctrl+f | Delete the word to the right of the cursor. | | ctrl+k | Delete everything to the right of the cursor. | + | ctrl+x | Cut selected text. | + | ctrl+c | Copy selected text. | + | ctrl+v | Paste text from the clipboard. | """ COMPONENT_CLASSES: ClassVar[set[str]] = { diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots/test_help_panel.svg b/tests/snapshot_tests/__snapshots__/test_snapshots/test_help_panel.svg index e33b40d37e..0ceb6a0954 100644 --- a/tests/snapshot_tests/__snapshots__/test_snapshots/test_help_panel.svg +++ b/tests/snapshot_tests/__snapshots__/test_snapshots/test_help_panel.svg @@ -19,161 +19,161 @@ font-weight: 700; } - .terminal-174514724-matrix { + .terminal-2718490692-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-174514724-title { + .terminal-2718490692-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-174514724-r1 { fill: #121212 } -.terminal-174514724-r2 { fill: #0178d4 } -.terminal-174514724-r3 { fill: #4f4f4f } -.terminal-174514724-r4 { fill: #c5c8c6 } -.terminal-174514724-r5 { fill: #fea62b;font-weight: bold } -.terminal-174514724-r6 { fill: #e0e0e0 } -.terminal-174514724-r7 { fill: #000000 } + .terminal-2718490692-r1 { fill: #121212 } +.terminal-2718490692-r2 { fill: #0178d4 } +.terminal-2718490692-r3 { fill: #4f4f4f } +.terminal-2718490692-r4 { fill: #c5c8c6 } +.terminal-2718490692-r5 { fill: #fea62b;font-weight: bold } +.terminal-2718490692-r6 { fill: #e0e0e0 } +.terminal-2718490692-r7 { fill: #000000 } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - HelpPanelApp + HelpPanelApp - + - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         ↑Scroll Up       -▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁         ↓Scroll Down     -         ←Move cursor     -left            -         →Move cursor     -right           -   home ^aGo to start     -    end ^eGo to end       -      pgupPage Up         -      pgdnPage Down       -     ^pgupPage Left       -     ^pgdnPage Right      -   shift+←Move cursor     -left and select▃▃ -        ^←Move cursor     -left a word     -  shift+^←Move cursor     -left a word and -select          -   shift+→Move cursor     -right and       -select          -        ^→Move cursor     -right a word    -  shift+^→Move cursor     -right a word    -and select      -         ⌫Delete          -character left  + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         ↑Scroll Up       +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁         ↓Scroll Down     +         ←Move cursor     +left            +         →Move cursor     +right or accept +the completion  +suggestion      +   home ^aGo to start     +    end ^eGo to end       +      pgupPage Up         +      pgdnPage Down       +     ^pgupPage Left       +     ^pgdnPage Right     ▇▇ +   shift+←Move cursor     +left and select +        ^←Move cursor     +left a word     +  shift+^←Move cursor     +left a word and +select          +   shift+→Move cursor     +right and       +select          +        ^→Move cursor     +right a word    +  shift+^→Move cursor     +right a word    +and select