@lvce-editor/editor-worker 1.5.0 → 1.6.0
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 +9 -4
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -6224,8 +6224,8 @@ const getMatchCount = matches => {
|
|
|
6224
6224
|
return matches.length / 2;
|
|
6225
6225
|
};
|
|
6226
6226
|
|
|
6227
|
-
const loadContent =
|
|
6228
|
-
const editor = getEditor(
|
|
6227
|
+
const loadContent = editorId => {
|
|
6228
|
+
const editor = getEditor(editorId);
|
|
6229
6229
|
const {
|
|
6230
6230
|
selections,
|
|
6231
6231
|
lines
|
|
@@ -6278,10 +6278,15 @@ const focusIndex = async (state, index) => {
|
|
|
6278
6278
|
if (index === matchIndex) {
|
|
6279
6279
|
return state;
|
|
6280
6280
|
}
|
|
6281
|
+
// TODO find next match and highlight it
|
|
6282
|
+
const matchRowIndex = matches[index * 2];
|
|
6283
|
+
const matchColumnIndex = matches[index * 2 + 1];
|
|
6284
|
+
// @ts-ignore
|
|
6285
|
+
const newSelections = new Uint32Array([matchRowIndex, matchColumnIndex, matchRowIndex, matchColumnIndex + value.length]);
|
|
6281
6286
|
// TODO set selections synchronously and render input match index,
|
|
6282
6287
|
// input value and new selections at the same time
|
|
6283
6288
|
// TODO
|
|
6284
|
-
|
|
6289
|
+
await invoke$3('Editor.setSelections', newSelections);
|
|
6285
6290
|
return {
|
|
6286
6291
|
...state,
|
|
6287
6292
|
matchIndex: index
|
|
@@ -7450,12 +7455,12 @@ const renderEditor = async id => {
|
|
|
7450
7455
|
newState
|
|
7451
7456
|
} = instance;
|
|
7452
7457
|
const commands = [];
|
|
7458
|
+
set$6(id, newState, newState);
|
|
7453
7459
|
for (const item of render) {
|
|
7454
7460
|
if (!item.isEqual(oldState, newState)) {
|
|
7455
7461
|
commands.push(await item.apply(oldState, newState));
|
|
7456
7462
|
}
|
|
7457
7463
|
}
|
|
7458
|
-
set$6(id, newState, newState);
|
|
7459
7464
|
return commands;
|
|
7460
7465
|
};
|
|
7461
7466
|
|