Skip to content

Comments and sexp movement #2899

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

Draft
wants to merge 3 commits into
base: published
Choose a base branch
from

Conversation

blueskyonmars
Copy link

What has changed?

Made selection and navigation consistently act like the VSCode defaults while in comments, even if the comments are at the tail or head end of selection.

This can be considered a work in progress. At the very least, I'd like feedback about naming. This is my first github PR too, so please let me know if something is wrong.

The change to paredit.ts::selectForwardSexp is to treat whitespace consistently. I left it as false so the change is obvious. I can remove the false if needed.

I don't see a way to test the mixed selection functionality programmatically, because the keybindings switch between VSCode and Calva selection, and only the Calva selection is programmatic in the tests.

See #2878 for some video of how it works.

Also note that there is a shortcoming described in the above issue, where {:a :b};|my comment backward movement and selection doesn't behave correctly (it uses VSCode selection which selects only part of the sexp).

Fixes #2878

My Calva PR Checklist

I have:

  • Read How to Contribute.
  • [x ] Directed this pull request at the dev branch. (Or have specific reasons to target some other branch.)
  • [x ] Made sure I have changed the PR base branch, so that it is not published. (Sorry for the nagging.)
  • [ x] Made sure there is an issue registered with a clear problem statement that this PR addresses, (created the issue if it was not present).
    • [x ] Updated the [Unreleased] entry in CHANGELOG.md, linking the issue(s) that the PR is addressing.
  • [ x] Figured if anything about the fix warrants tests on Mac/Linux/Windows/Remote/Whatever, and either tested it there if so, or mentioned it in the PR.
  • [x ] Added to or updated docs in this branch, if appropriate
  • [ x] Tests
    • [x ] Tested the particular change
    • [ x] Figured if the change might have some side effects and tested those as well.
  • [ x] Formatted all JavaScript and TypeScript code that was changed. (use the prettier extension or run npm run prettier-format)
  • [x ] Confirmed that there are no linter warnings or errors (use the eslint extension, run npm run eslint before creating your PR, or run npm run eslint-watch to eslint as you go).

Copy link

netlify bot commented Jul 19, 2025

Deploy Preview for calva-docs ready!

Name Link
🔨 Latest commit 86598f6
🔍 Latest deploy log https://app.netlify.com/projects/calva-docs/deploys/687ae95d0f1686000811051b
😎 Deploy Preview https://deploy-preview-2899--calva-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

with Select Forward Sexp starting from a comment and selecting into code sexp, selection seems to select blocks of text
2 participants