fix(editor): Force parse on long expressions (#5009)

 Force parse on long expressions
This commit is contained in:
Iván Ovejero
2022-12-22 17:42:37 +01:00
committed by GitHub
parent c738aa53e9
commit 22fcc8f2be
3 changed files with 23 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import { highlighter } from '@/plugins/codemirror/resolvableHighlighter';
import { outputTheme } from './theme';
import type { Plaintext, Resolved, Segment } from '@/types/expressions';
import { forceParse } from '@/utils/forceParse';
export default Vue.extend({
name: 'ExpressionEditorModalOutput',
@@ -37,7 +38,12 @@ export default Vue.extend({
};
},
mounted() {
const extensions = [outputTheme(), EditorState.readOnly.of(true), EditorView.lineWrapping];
const extensions = [
outputTheme(),
EditorState.readOnly.of(true),
EditorView.lineWrapping,
EditorView.domEventHandlers({ scroll: forceParse }),
];
this.editor = new EditorView({
parent: this.$refs.root as HTMLDivElement,