-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
#610 Multi Cursor for paredit #1606
base: dev
Are you sure you want to change the base?
#610 Multi Cursor for paredit #1606
Conversation
Looks like you have had a nice start! Please let me know when you think I should test something. Consider basing this PR onto the one where you removed left/right selection confusion. |
@PEZ I already started rebasing this PR on #1608. I'll switch back to prepping that PR for merging. I do have a(nother) question:
|
Just putting a note here that the tests have to be rewritten at least somewhat for this. Your shorthand/dsl for describing documents/text assumes two | symbols are a single directionless selection, instead of 2 cursors. This will need to change but I want to do so in the least disruptive way possible. Any thoughts? |
I've been thinking a bit about this, actually. I'd like to keep the current semantics as long as we only have one cursor to consider. How about that for multi cursor cases, we number the cursors? |
36e500a
to
103087f
Compare
Sure thing, that's a reasonable idea - it might be tricky if, for any reason, any of the existing tests had a numeral after the Similarly then, we're assuming that if there's something like |
I do need help with another thing @PEZ :
That function checks some stuff around the current primary cursor, and then sets vsc contexts like:
Which are then checked by those aforementioned cursor contextual commands. What I should prob do at some point is list all of them, and see how likely it is users would expect or desire multi cursor for those in particular. In any case, this clearly doesn't work as-is for multi-cursor. A few options:
|
Tricky with the contexts! I think that for all commands affected this cursors contexts should be removed and the commands should handle the check on a per cursor basis. If it should be done in this PR or not... Depends. Mostly on how much work you think is involved. I guess there is some MVP we can cut out. That said, one place I miss multi cursors a lot is when moving by sexpression. 😄 |
103087f
to
f53a13f
Compare
Well, the contexts are really helpful for users making contextual keybindings no? For the "when expressions"? |
Yes, but they also get to be an ”API” that now proves tricky to maintain. If should keep the context we need to figure out what the semantics of them is in a multi-cursor world. Probably they would refer to ”all cursors”? But that will still lead to weird effects in situations where cursors are in different contexts, like one is in a comment and some others are not, what would Hmmm... I think we probably should remove the contexts. |
Regarding
|
If I remember correctly, vscode does not have contexts for cursor location, so the lack of prior art isn't really telling us much.
Pretty sure this is not possible. What's important is that we can keep Calva's default behavior for moving the cursor. I don't think the when contexts should be kept if we can achieve the correct movement without them. And that should be possible by making forward/backward sexp check the cursor position with the code we already have and relay to the builtin move by word commands in those cases where the when contexts would have solved that. Adding more settings makes Calva more complicated for the users and for us. I'd rather avoid that, if we can. |
69c0088
to
7993eaf
Compare
With right->left selectios
@@ -2722,7 +2722,7 @@ | |||
"watch-docs": "mkdocs serve", | |||
"clean": "rimraf ./out && rimraf ./tsconfig.tsbuildinfo && rimraf ./cljs-out", | |||
"update-grammar": "node ./src/calva-fmt/update-grammar.js ./src/calva-fmt/atom-language-clojure/grammars/clojure.cson clojure.tmLanguage.json", | |||
"precompile": "npm i && npm run clean && npm run update-grammar && npm run prettier-format", | |||
"precompile": "npm i && npm run clean && npm run update-grammar", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this @PEZ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not needed to compile. It's needed before we run the prettier-format-watch
script. And there's a preprettier-format-watch
for that.
any news guys? |
@dosbol, unfortunately not. I tried to resolve the conflicts some months ago, but failed miserably. It doesn't mean this work can't be salvaged and continued, just that it needs a focused effort over a longer period. |
Fixes #610
What has Changed?
Fixes #610
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.ci/circleci: build
test.npm run prettier-format
)npm run eslint
before creating your PR, or runnpm run eslint-watch
to eslint as you go).Ping @PEZ, @bpringe