Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode: copy, paste, redo and undo through command palate #1677

Merged
merged 6 commits into from
Jan 18, 2025

Conversation

BlueDrink9
Copy link
Contributor

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)

BlueDrink9 and others added 5 commits January 12, 2025 12:26
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)
Same reason - more reliable, avoids conflicts with vim mode or user rebindings
@BlueDrink9 BlueDrink9 changed the title vscode: redo and undo through command palate vscode: copy, paste, redo and undo through command palate Jan 13, 2025
@BlueDrink9
Copy link
Contributor Author

Also added copy and paste while I'm there, for the same reason.

@nriley
Copy link
Collaborator

nriley commented Jan 18, 2025

On the community backlog session we discussed that this will make the experience worse for people who do not have the command server installed but at this point this should be a rare occurrence and the command server should essentially be considered a dependency if you are using visual studio code and Talon.

@nriley nriley merged commit f34f73d into talonhub:main Jan 18, 2025
2 checks passed
@BlueDrink9
Copy link
Contributor Author

BlueDrink9 commented Jan 18, 2025

Good to know. Would it be possible to make the whole class definition dependent on whether it can reach the server? Then the default edit shortcuts would be used as a fallback

I also found a few other commands that would be useful to send via server, eg find. I'll open a PR for those, since the decision is to go with the command versions generally

@lunixbochs
Copy link
Collaborator

won't this break undo commands when the edit view isn't focused?

@nriley
Copy link
Collaborator

nriley commented Jan 19, 2025

@lunixbochs good point, we should probably revert this.

@BlueDrink9 we did discuss that, @AndreasArvidsson should be able to clarify.

@BlueDrink9
Copy link
Contributor Author

Confused why undo would break outside the editor window - is it because ctrl+z does different commands outside the edit window?

@BlueDrink9
Copy link
Contributor Author

I presume the command server can tell us if the editor window is focused - maybe this just needs a bit more smarts

@AndreasArvidsson
Copy link
Collaborator

I just tried editor.action.clipboardPasteAction and that worked fine in the search widget, settings panel and the terminal. There might be a scenario were these actions fail, but as far as I can tell vscode has done a good job of implementing them across the application.

@nriley
Copy link
Collaborator

nriley commented Jan 19, 2025

If those cases work, the only example I can think of where it would break would be system open and save dialogs; these are modal. Sometimes you will paste a file name into those, for example.

@AndreasArvidsson
Copy link
Collaborator

You're right. In the save dialog editor.action.clipboardPasteAction doesn't work and we get a time out error from the command client. We probably need to revert this.

nriley added a commit to nriley/talon_community that referenced this pull request Jan 19, 2025
nriley pushed a commit that referenced this pull request Jan 19, 2025
Reverts #1677

These actions doesn't work in all scenarios. eg a save dialog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants