From 771f47f809ad539cbd47e5aa3a018c26cc0ad734 Mon Sep 17 00:00:00 2001 From: Joshua Aresty Date: Sat, 29 Jun 2024 17:58:19 -0700 Subject: [PATCH] Paste and select can be much faster - First iterate through all new lines and extend upward - Then select just the first line --- GPT/gpt.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/GPT/gpt.py b/GPT/gpt.py index aeb724a9..393f42ba 100644 --- a/GPT/gpt.py +++ b/GPT/gpt.py @@ -136,7 +136,11 @@ def paste_and_select(result: str): actions.user.paste(result) - for _ in result: + lines = result.split("\n") + for _ in lines[:-1]: + actions.edit.extend_up() + actions.edit.extend_line_end() + for _ in lines[0]: actions.edit.extend_left() def gpt_apply_prompt(prompt: str, text_to_process: str | list[str]) -> str: