@lvce-editor/editor-worker 14.2.0 → 14.3.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 +6 -3
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -6652,9 +6652,12 @@ const isAlphaNumeric = char => {
|
|
|
6652
6652
|
return RE_ALPHA_NUMERIC.test(char);
|
|
6653
6653
|
};
|
|
6654
6654
|
|
|
6655
|
+
const isWordChar = char => {
|
|
6656
|
+
return isAlphaNumeric(char) || char === '_';
|
|
6657
|
+
};
|
|
6655
6658
|
const getWordStartIndex = (line, index) => {
|
|
6656
6659
|
for (let i = index - 1; i >= 0; i--) {
|
|
6657
|
-
if (!
|
|
6660
|
+
if (!isWordChar(line[i])) {
|
|
6658
6661
|
return i + 1;
|
|
6659
6662
|
}
|
|
6660
6663
|
}
|
|
@@ -6662,11 +6665,11 @@ const getWordStartIndex = (line, index) => {
|
|
|
6662
6665
|
};
|
|
6663
6666
|
const getWordEndIndex = (line, index) => {
|
|
6664
6667
|
for (let i = index; i < line.length; i++) {
|
|
6665
|
-
if (!
|
|
6668
|
+
if (!isWordChar(line[i])) {
|
|
6666
6669
|
return i;
|
|
6667
6670
|
}
|
|
6668
6671
|
}
|
|
6669
|
-
return line.length
|
|
6672
|
+
return line.length;
|
|
6670
6673
|
};
|
|
6671
6674
|
const getWordMatchAtPosition = (lines, rowIndex, columnIndex) => {
|
|
6672
6675
|
const line = lines[rowIndex];
|