Hi Marijn, please let me thank you for this great work!
Please, let me know if this source piece it’s OK or it’s a bad practice to avoid carriage return to simulate a single line input:
const Editor = new EditorView({
state: EditorState.create({
doc,
extensions: [
history(),
oneDark,
oneDarkHighlightStyle,
basicSetup,
keymap.of([defaultTabBinding]),
css(),
EditorView.updateListener.of(update => {
const docString = Editor.state.doc.toString();
// Avoid carriage return
if (update.docChanged && (docString.match(/\n/g) || []).length) {
// Undo changes
undo(Editor);
} else if (
update.docChanged &&
me.value !== docString &&
window.CSS.supports("width", docString)
) {
// Update Vue state
me.value = docString;
}
})
]
}),
parent: this.$refs.editor
});
Many thanks! :slight_smile: