@lvce-editor/editor-worker 19.61.2 → 19.61.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editorWorkerMain.js +8 -6
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -10286,14 +10286,16 @@ const getChanges = (lines, selections, languageConfiguration, indentUnit) => {
|
|
|
10286
10286
|
if (isEmpty(selectionStartRow, selectionStartColumn, selectionEndRow, selectionEndColumn)) {
|
|
10287
10287
|
const line = lines[selectionStartRow];
|
|
10288
10288
|
const before = line.slice(0, selectionStartColumn);
|
|
10289
|
+
const after = line.slice(selectionStartColumn);
|
|
10289
10290
|
const indent = getIndent(before);
|
|
10290
10291
|
if (shouldIncreaseIndent(before, increaseIndentRegex)) {
|
|
10292
|
+
const inserted = after ? ['', indent + indentUnit, indent] : ['', indent + indentUnit];
|
|
10291
10293
|
changes.push({
|
|
10292
10294
|
deleted: getSelectionText({
|
|
10293
10295
|
lines
|
|
10294
10296
|
}, range),
|
|
10295
10297
|
end: end,
|
|
10296
|
-
inserted
|
|
10298
|
+
inserted,
|
|
10297
10299
|
origin: InsertLineBreak,
|
|
10298
10300
|
start: start
|
|
10299
10301
|
});
|
|
@@ -15294,10 +15296,10 @@ const getCursorsVirtualDom = cursors => {
|
|
|
15294
15296
|
return dom;
|
|
15295
15297
|
};
|
|
15296
15298
|
|
|
15297
|
-
const getEditorCursorsVirtualDom = cursorInfos => {
|
|
15298
|
-
const cursorsDom = getCursorsVirtualDom([...cursorInfos]);
|
|
15299
|
+
const getEditorCursorsVirtualDom = (cursorInfos, focused = true) => {
|
|
15300
|
+
const cursorsDom = focused ? getCursorsVirtualDom([...cursorInfos]) : [];
|
|
15299
15301
|
return [{
|
|
15300
|
-
childCount: cursorInfos.length,
|
|
15302
|
+
childCount: focused ? cursorInfos.length : 0,
|
|
15301
15303
|
className: 'LayerCursor',
|
|
15302
15304
|
type: Div
|
|
15303
15305
|
}, ...cursorsDom];
|
|
@@ -15553,7 +15555,7 @@ const editorLayersNode = {
|
|
|
15553
15555
|
type: Div
|
|
15554
15556
|
};
|
|
15555
15557
|
const getEditorLayersVirtualDom = (selectionInfos, textInfos, differences, lineNumbers = true, highlightedLine = -1, cursorInfos = [], diagnostics = [], visibleLineIndices = [], endOfLineDecorations = [], bracketMatchInfos = [], focused = true, visibleViewLineIndices = [], problemsHighlightedRow = -1, roundedSelection = false) => {
|
|
15556
|
-
return [editorLayersNode, ...getEditorSelectionsVirtualDom(selectionInfos, focused, roundedSelection), ...getEditorRowsVirtualDom(textInfos, differences, lineNumbers, highlightedLine, visibleLineIndices, endOfLineDecorations, visibleViewLineIndices, problemsHighlightedRow), ...getEditorCursorsVirtualDom(cursorInfos), ...getEditorDiagnosticsVirtualDom(diagnostics, bracketMatchInfos)];
|
|
15558
|
+
return [editorLayersNode, ...getEditorSelectionsVirtualDom(selectionInfos, focused, roundedSelection), ...getEditorRowsVirtualDom(textInfos, differences, lineNumbers, highlightedLine, visibleLineIndices, endOfLineDecorations, visibleViewLineIndices, problemsHighlightedRow), ...getEditorCursorsVirtualDom(cursorInfos, focused), ...getEditorDiagnosticsVirtualDom(diagnostics, bracketMatchInfos)];
|
|
15557
15559
|
};
|
|
15558
15560
|
|
|
15559
15561
|
const getEditorScrollBarDiagnosticsVirtualDom = scrollBarDiagnostics => {
|
|
@@ -16061,7 +16063,7 @@ const renderSelections = {
|
|
|
16061
16063
|
cursorInfos = [],
|
|
16062
16064
|
selectionInfos = []
|
|
16063
16065
|
} = newState;
|
|
16064
|
-
const cursorsDom = getCursorsVirtualDom(cursorInfos);
|
|
16066
|
+
const cursorsDom = newState.focused ? getCursorsVirtualDom(cursorInfos) : [];
|
|
16065
16067
|
const selectionsDom = getSelectionsVirtualDom(selectionInfos, newState.focused, newState.roundedSelection);
|
|
16066
16068
|
return [/* method */'setSelections', cursorsDom, selectionsDom];
|
|
16067
16069
|
},
|