@lvce-editor/editor-worker 1.5.1 → 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 +8 -3
- 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
|