quarto-dev / quarto-dev/quarto
visual editor: support multi-cursor 'add next match' in the find API
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 645
- Forks
- 62
- Avg merge
- 17h 42m
- Merged PRs (30d)
- 13
Description
Context
RStudio's "Find and Add Next" and "Find All" commands build a multi-cursor selection from the current find match (Ace's "add next selection" feature). In the visual editor these commands work inside code chunks (routed to the chunk's embedded Ace editor, rstudio/rstudio#18651), but they cannot work in prose: the editor's find API only exposes single-selection operations, so RStudio currently reports the commands as disabled there.
Reported by users in rstudio/rstudio#16540, where the repro is specifically prose.
Feature request
An "add next match to selection" capability (and ideally a companion "select all matches") in the editor's find API, so embedders can offer multi-cursor style editing over find results in prose.
Technical notes
EditorFindReplace(packages/editor/src/editor/editor.ts, exposed viaEditor.getFindReplace()) currently exposesselectFirst/selectCurrent/selectNext/selectPrevious/replace/replaceAll, all single-selection, backed by theFindPlugininpackages/editor/src/behaviors/find.ts.- ProseMirror's
TextSelectionis a single range and multi-range selection is not a native concept, so this likely requires either a customSelectionsubclass or a plugin that maintains the additional ranges as decorations and fans typed edits out to every range.
Not a small change -- filing so the request is tracked upstream and can be prioritized. Happy to discuss design or contribute if there's an agreed direction.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with EditorFindReplace in packages/editor/src/editor/editor.ts and the FindPlugin in packages/editor/src/behaviors/find.ts. Review how the current single-selection operations work and investigate the ProseMirror TextSelection constraint before discussing an agreed design. Done means prose find results expose add-next-match, and ideally select-all, to embedders with multi-cursor editing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100