@nethru/ui 2.1.39 → 2.1.41
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/base/editor/Editor.js +10 -4
- package/package.json +1 -1
package/base/editor/Editor.js
CHANGED
|
@@ -64,9 +64,15 @@ export default function Editor({
|
|
|
64
64
|
while (true) {
|
|
65
65
|
cursor.next();
|
|
66
66
|
if (cursor.done) break;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
const {
|
|
68
|
+
from,
|
|
69
|
+
to
|
|
70
|
+
} = cursor.value;
|
|
71
|
+
if (from !== to) {
|
|
72
|
+
view.dispatch({
|
|
73
|
+
effects: effect.of([decoration.range(from, to)])
|
|
74
|
+
});
|
|
75
|
+
}
|
|
70
76
|
}
|
|
71
77
|
}, [view, highlight, keyword, isRegExp]);
|
|
72
78
|
const scrollToBottom = useCallback(() => {
|
|
@@ -204,7 +210,7 @@ function makeHighlight() {
|
|
|
204
210
|
};
|
|
205
211
|
}
|
|
206
212
|
function makeEslinter(format, eslintRules, onEslintUpdate, customVariables) {
|
|
207
|
-
const regex = /\{\{(
|
|
213
|
+
const regex = /\{\{([^}]+)\}\}/g;
|
|
208
214
|
if (format === 'javascript') {
|
|
209
215
|
return linter(view => {
|
|
210
216
|
const text = view.state.doc.toString();
|