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

未关闭
#1,103 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
frontend

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
TypeScript
星标
665
派生
69
平均合并
2 天 4 小时
30 天内合并 PR
14

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

quarto-dev/quarto 的其他 Issue

查看 quarto-dev/quarto 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。