If going rightward one word an no more word go to end

This commit is contained in:
Dave Pearson
2023-01-26 21:52:40 +00:00
parent 3399fb868f
commit 7de4924cf2

View File

@@ -332,7 +332,9 @@ class Input(Widget, can_focus=True):
def action_cursor_right_word(self) -> None:
"""Move the cursor right to the start of a word."""
hit = re.search(self._WORD_START, self.value[self.cursor_position :])
if hit is not None:
if hit is None:
self.cursor_position = len(self.value)
else:
self.cursor_position += hit.start()
def action_delete_right(self) -> None: