fix(tui): simplify behaviour of pasting clipboard to textbox
Closes #107
This commit is contained in:
@@ -1805,12 +1805,8 @@ def run_textual_interactive(
|
||||
return
|
||||
|
||||
prompt = self.query_one("#prompt", ChatTextArea)
|
||||
# Insert at cursor position
|
||||
pos = prompt.cursor_position
|
||||
current = prompt.value
|
||||
new_value = current[:pos] + text + current[pos:]
|
||||
prompt.value = new_value
|
||||
prompt.cursor_position = pos + len(text)
|
||||
prompt.insert(text)
|
||||
prompt.focus()
|
||||
|
||||
def action_tab_complete(self) -> None:
|
||||
"""Handle TAB: cycle completions when visible, otherwise no-op.
|
||||
@@ -1874,8 +1870,6 @@ def run_textual_interactive(
|
||||
else:
|
||||
prompt.value = selected + " "
|
||||
|
||||
prompt.cursor_position = len(prompt.value)
|
||||
|
||||
def _hide_completions(self) -> None:
|
||||
self._comp_items = []
|
||||
self._comp_index = -1
|
||||
|
||||
Reference in New Issue
Block a user