We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9c0aeb commit 2d773ceCopy full SHA for 2d773ce
src/textual/widgets/_input.py
@@ -62,6 +62,7 @@ def cursor(cls, cursor_position: int) -> Selection:
62
63
@property
64
def is_empty(self) -> bool:
65
+ """Return True if the selection is empty."""
66
return self.start == self.end
67
68
@@ -209,10 +210,12 @@ class Input(ScrollView):
209
210
211
212
def cursor_position(self) -> int:
213
+ """The current position of the cursor, corresponding to the end of the selection."""
214
return self.selection.end
215
216
@cursor_position.setter
217
def cursor_position(self, position: int) -> None:
218
+ """Set the current position of the cursor."""
219
self.selection = Selection.cursor(position)
220
221
selection: Reactive[Selection] = reactive(Selection.cursor(0))
0 commit comments