mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(editor): Fix SQL editor issue (#7236)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -141,7 +141,11 @@ export default defineComponent({
|
||||
const extensions = [
|
||||
sqlWithN8nLanguageSupport(),
|
||||
expressionInputHandler(),
|
||||
codeNodeEditorTheme({ isReadOnly: this.isReadOnly, customMaxHeight: '350px' }),
|
||||
codeNodeEditorTheme({
|
||||
isReadOnly: this.isReadOnly,
|
||||
customMaxHeight: '350px',
|
||||
customMinHeight: this.rows,
|
||||
}),
|
||||
lineNumbers(),
|
||||
EditorView.lineWrapping,
|
||||
EditorState.readOnly.of(this.isReadOnly),
|
||||
@@ -188,15 +192,7 @@ export default defineComponent({
|
||||
mounted() {
|
||||
if (!this.isReadOnly) codeNodeEditorEventBus.on('error-line-number', this.highlightLine);
|
||||
|
||||
let doc = this.modelValue;
|
||||
|
||||
const lines = doc.split('\n');
|
||||
|
||||
if (lines.length < this.rows) {
|
||||
doc += '\n'.repeat(this.rows - lines.length);
|
||||
}
|
||||
|
||||
const state = EditorState.create({ doc, extensions: this.extensions });
|
||||
const state = EditorState.create({ doc: this.modelValue, extensions: this.extensions });
|
||||
|
||||
this.editor = new EditorView({ parent: this.$refs.sqlEditor as HTMLDivElement, state });
|
||||
this.editorState = this.editor.state;
|
||||
|
||||
Reference in New Issue
Block a user