Skip to content

Conversation

@jramosg
Copy link

@jramosg jramosg commented Jan 21, 2026

What has changed?

Implemented pair/triple selecting in condp forms, allowing users to expand selections to include entire test/result pairs and test :>> function triples.

Fixes #2995

My Calva PR Checklist

I have:

  • Read How to Contribute.
  • Directed this pull request at the dev branch. (Or have specific reasons to target some other branch.)
  • Made sure I have changed the PR base branch, so that it is not published. (Sorry for the nagging.)
  • Made sure there is an issue registered with a clear problem statement that this PR addresses, (created the issue if it was not present).
    • Updated the [Unreleased] entry in CHANGELOG.md, linking the issue(s) that the PR is addressing.
  • 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.
  • Added to or updated docs in this branch, if appropriate
  • Tests
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
  • Formatted all JavaScript and TypeScript code that was changed. (use the prettier extension or run npm run prettier-format)
  • 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).

Enhance the growSelection function to support:
- Test/result pairs in condp forms (e.g., condp = x 1 "one" 2 "two")
- Test :>> function triples in condp (e.g., condp some [1 2] #{0 6} :>> inc)
- Default values (odd element at the end is not paired)

This allows users to expand selections correctly when working with
condp conditional expressions, improving the editing experience in Calva.

Known limitation: There is a bug (also affecting case forms) where
selecting the first element of a pair and growing the selection causes
it to jump backward to the test expression instead of forward to include
the pair. This needs further investigation of the rangesForSexpsInList()
behavior. The main use case (selecting the second element first) works
correctly.

Fixes BetterThanTomorrow#2995
@netlify
Copy link

netlify bot commented Jan 21, 2026

Deploy Preview for calva-docs ready!

Name Link
🔨 Latest commit ca9b7b9
🔍 Latest deploy log https://app.netlify.com/projects/calva-docs/deploys/697107cdcb51060008d82837
😎 Deploy Preview https://deploy-preview-2998--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.

1 participant