Skip to content

Commit

Permalink
Cleanup model blend cursorless grammar (#81)
Browse files Browse the repository at this point in the history
- Model blend to <target> didn't specify a source; now it specifies the
source as clipboard
- Model blend <target> was only implicitly dropping the 'this'
  • Loading branch information
jaresty authored Jul 1, 2024
1 parent 2dba8a7 commit cbfb4c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions GPT/beta-commands/beta-cursorless.talon
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@ model blend <user.cursorless_target> to <user.cursorless_target>:
result = user.gpt_blend_list(target_text, destination_text)
user.cursorless_insert(default_destination, result)

model blend to <user.cursorless_target>:
target_text = edit.selected_text()
model blend clip to <user.cursorless_target>:
clipboard_text = clip.text()
destination_text = user.cursorless_get_text(cursorless_target)
default_destination = user.cursorless_create_destination(cursorless_target)
result = user.gpt_blend(target_text, destination_text)
result = user.gpt_blend(clipboard_text, destination_text)
user.cursorless_insert(default_destination, result)

model blend <user.cursorless_target>:
target_text = user.cursorless_get_text_list(cursorless_target)
result = user.gpt_blend_list(target_text, edit.selected_text())
user.paste(result)
2 changes: 1 addition & 1 deletion GPT/beta-commands/beta-gpt.talon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tag: user.gpt_beta
model find <user.text>: user.gpt_find_talon_commands(user.text)

# Using the context of the text on the clipboard, update the selected text
model blend clipboard:
model blend clip:
clipboard_text = clip.text()
destination_text = edit.selected_text()
result = user.gpt_blend(clipboard_text, destination_text)
Expand Down

0 comments on commit cbfb4c0

Please sign in to comment.