Skip to content

Commit

Permalink
vscode: copy, paste, redo and undo through command palate (talonhub#1677
Browse files Browse the repository at this point in the history
)

Makes these actions more reliable than the default of sending
keypresses, especially if the user has rebound those keys or is in a
different editor mode (eg with vim extension)

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jeff Knaus <knaus.jeff@gmail.com>
Co-authored-by: Nicholas Riley <com-github@sabi.net>
  • Loading branch information
4 people authored Jan 18, 2025
1 parent cf5807d commit f34f73d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps/vscode/vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ def toggle_comment():

@ctx.action_class("edit")
class EditActions:
def undo():
actions.user.vscode("undo")

def redo():
actions.user.vscode("redo")

def copy():
actions.user.vscode("editor.action.clipboardCopyAction")

def paste():
actions.user.vscode("editor.action.clipboardPasteAction")

# talon edit actions
def indent_more():
actions.user.vscode("editor.action.indentLines")
Expand Down

0 comments on commit f34f73d

Please sign in to comment.