From ebc879dc8b46f936a3cd0756a9dedec28bd8a04e Mon Sep 17 00:00:00 2001 From: LU XIANGRUI <1078666705@qq.com> Date: Tue, 17 Nov 2026 13:32:03 +0900 Subject: [PATCH] feat(plugins): folded ranges and wrapped rows for editor panels (#3890) An editor panel's page could not tell which lines are folded or how many rows a soft-wrapped line takes, so a minimap drew folded code and drifted from the editor. openidea.editor now has folded() ([{ fromLine, toLine }], nested folds merged), wrapped(fromLine, toLine) (visual rows per line, 0 for folded-away lines, null without soft wrap, at most 2000 lines) and onLayout(fn) with { folded, softWrap }, at most once a frame. Folds come from foldedRanges and rows from the editor's own line blocks. Closes #3867 Co-authored-by: wildcatDownstairs <26499420+wildcatDownstairs@users.noreply.github.com> --- .../fixtures/editor-panel/web/index.html | 52 ++++++-- plugins/README.md | 17 ++- .../plugins/__tests__/editorPanels.test.tsx | 125 +++++++++++++++++- src/features/plugins/views/WebView.tsx | 27 +++- src/features/plugins/views/editorPanel.tsx | 69 +++++++++- src/features/plugins/views/frame-bridge.js | 8 +- 6 files changed, 271 insertions(+), 27 deletions(-) diff --git a/crates/ide-plugin/tests/fixtures/editor-panel/web/index.html b/crates/ide-plugin/tests/fixtures/editor-panel/web/index.html index 97e1fd73c..9d0ced588 100644 --- a/crates/ide-plugin/tests/fixtures/editor-panel/web/index.html +++ b/crates/ide-plugin/tests/fixtures/editor-panel/web/index.html @@ -23,7 +23,7 @@