MCPcopy Create free account
hub / github.com/Auto-Plugin/milkup / forwardSelection

Method forwardSelection

src/core/nodeviews/code-block.ts:1552–1565  ·  view source on GitHub ↗

* 转发选区到 ProseMirror

()

Source from the content-addressed store, hash-verified

1550 * 转发选区到 ProseMirror
1551 */
1552 private forwardSelection(): void {
1553 const pos = this.getPos();
1554 if (pos === undefined) return;
1555
1556 const { from, to } = this.cm.state.selection.main;
1557 const start = pos + 1 + from;
1558 const end = pos + 1 + to;
1559
1560 const selection = TextSelection.create(this.view.state.doc, start, end);
1561
1562 if (!this.view.state.selection.eq(selection)) {
1563 this.view.dispatch(this.view.state.tr.setSelection(selection));
1564 }
1565 }
1566
1567 /**
1568 * 跳出代码块

Callers 1

constructorMethod · 0.95

Calls 1

setSelectionMethod · 0.45

Tested by

no test coverage detected