Skip to content

Commit

Permalink
Merge pull request #5484 from ddkasa/input-binding-desc
Browse files Browse the repository at this point in the history
Input 'right' Binding Description & Documentation
  • Loading branch information
willmcgugan authored Feb 13, 2025
2 parents 4aac6eb + b4e5133 commit 3da0a4f
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 73 deletions.
16 changes: 15 additions & 1 deletion src/textual/widgets/_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down Expand Up @@ -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]] = {
Expand Down
Loading

0 comments on commit 3da0a4f

Please sign in to comment.