feat(Set Node): Overhaul (#6348)

Github issue / Community forum post (link here to close automatically):
https://github.com/n8n-io/n8n/pull/6348

---------

Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
Co-authored-by: Marcus <marcus@n8n.io>
This commit is contained in:
Michael Kret
2023-09-19 13:16:35 +03:00
committed by GitHub
parent 050ba706d3
commit 3a474552b2
42 changed files with 2626 additions and 410 deletions

View File

@@ -88,6 +88,10 @@ export default defineComponent({
type: Boolean,
default: false,
},
rows: {
type: Number,
default: -1,
},
},
data(): SQLEditorData {
return {
@@ -184,7 +188,16 @@ export default defineComponent({
mounted() {
if (!this.isReadOnly) codeNodeEditorEventBus.on('error-line-number', this.highlightLine);
const state = EditorState.create({ doc: this.modelValue, extensions: this.extensions });
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 });
this.editor = new EditorView({ parent: this.$refs.sqlEditor as HTMLDivElement, state });
this.editorState = this.editor.state;
highlighter.addColor(this.editor as EditorView, this.resolvableSegments);