visual editor: support multi-cursor 'add next match' in the find API

Aperta
#1,103 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

visual-editor
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 via Editor.getFindReplace()) currently exposes selectFirst / selectCurrent / selectNext / selectPrevious / replace / replaceAll, all single-selection, backed by the FindPlugin in packages/editor/src/behaviors/find.ts.
  • ProseMirror's TextSelection is a single range and multi-range selection is not a native concept, so this likely requires either a custom Selection subclass 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.

Lingua principale
TypeScript
Stelle
665
Fork
69
Merge medio
2g 4h
PR unite (30g)
14

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quarto-dev/quarto

Tutte le issue di quarto-dev/quarto

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.