-
-
Notifications
You must be signed in to change notification settings - Fork 227
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 paredit commands to accept args - and use them for multicursor & copying when killing #2482
Conversation
✅ Deploy Preview for calva-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This is so awesome. The exact right way to go with this. |
df4840e
to
ea2c220
Compare
I like this idea. Please go ahead with issue and documentation. I think a mention about the arguments could be added as a sub-header just before we mention that strings are treated as lists: https://calva.io/paredit/#strings-are-not-lists-but-anyway Question. The kill commands support two options in their argument ( |
|
My thought was to place them in a sub section underneath But if you'd like to surface them higher, I think that could make sense - I'm not particularly partial to either. |
A thing with commands is that they are API. Even if keyboard shortcuts are an obvious place where this API surfaces it doesn't stop there. They may be used Joyride scripts, or from some other extension. That said, I'm totally fine with this going to the Keyboard Shortcuts section. That commands are API also means that we need to be careful around them. Whatever we add we may need to support forever. Dunno what this says about the |
Ah yes, good point |
Might be worth introducing the concept with kill+copy in the section you'd suggested, and allude to that in the experimental multicursor section at the bottom. Maybe we rename to I mean, technically, if we kept |
@PEZ I've pushed a couple commits, feel free to review by commit. Namely, the last two:
|
Sorry for the delay. LGTM! |
Regarding the note about fallback for grow/shrink selection. It reminds me that I haven't checked if the multi-cursor selection commands participate in the grow/shrink. I now checked, and they don't. Anyway, could be good to look at this, as it may be important for the general architecture of the multi-cursor editing. |
Like: `args: {multicursor: true/false}`
Like: `"args": {copy: true/false}`
Co-authored-by: Peter Strömberg <pez@pezius.com>
de41797
to
e9e8e89
Compare
What has changed?
The philosophy behind this was already described in the private calva team chat, but I can repost here if desired.
/src/paredit/extension.ts
multicursor and kill cmds accept an arg, for now a map with a single key for each respective type of command.{multicursor: boolean}
calva.paredit.multicursor
for that particular keybinding.{copy: boolean}
calva.paredit.killAlsoCutsToClipboard
for that particular keybinding.This will only affect users that utilize these args. There have been no documentation additions so if merged as-is there should be no changes for anyone, but if we like this idea, we'll want to probably mention this somewhere.
I will do some more changes here, like fortifying the static typing and CHANGELOG entry, and aforementioned documentation, and perhaps some basic tests, if we like this idea overall.
I'll create an issue if we like this idea.
Fixes #
My Calva PR Checklist
I have:
dev
branch. (Or have specific reasons to target some other branch.)published
. (Sorry for the nagging.)[Unreleased]
entry inCHANGELOG.md
, linking the issue(s) that the PR is addressing.npm run prettier-format
)npm run eslint
before creating your PR, or runnpm run eslint-watch
to eslint as you go).Ping @PEZ, @bpringe, @corasaurus-hex, @Cyrik