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

Allow custom actions per language type #1860

Open
fidgetingbits opened this issue Sep 7, 2023 · 2 comments
Open

Allow custom actions per language type #1860

fidgetingbits opened this issue Sep 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@fidgetingbits
Copy link
Collaborator

It would be nice to be able to have per-language custom actions. As an example I added a few markdown specific actions in cursorless-settings/experimental/actions_custom.csv:

toggle list,markdown.extension.checkTaskList
heading up,markdown.extension.editing.toggleHeadingUp
heading down,markdown.extension.editing.toggleHeadingDown

The caveat to this is that these will now be active in every file I open, not just markdown files. This is probably somewhat related to #1606, as mentioned in slack.

@auscompgeek auscompgeek added the enhancement New feature or request label Sep 7, 2023
@auscompgeek
Copy link
Member

auscompgeek commented Sep 7, 2023

I think this can be easily worked around by creating a .talon-list matching on language, like

list: user.cursorless_custom_action
code.language: markdown
-
toggle list: markdown.extension.checkTaskList
heading up: markdown.extension.editing.toggleHeadingUp
heading down: markdown.extension.editing.toggleHeadingDown

This will completely override actions_custom.csv for the language, so any custom actions there you might want to use won't be available in the overriding context. The other downside here is that the Talon side needs to know the correct language.

@fidgetingbits
Copy link
Collaborator Author

That's an interesting idea. I do have many other custom actions that I don't want to lose, but I guess I could just replicate them into every per-language .talon-list in the interim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants