Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@
// Prevent default action of Enter key to avoid form submission
event.preventDefault();
// Append a newline character to the widget value
this.widget.value = this.widget.value + '\n';
let cursorPosition = this.widget.selectionStart;
let textBefore = this.widget.value.substring(0, cursorPosition);
let textAfter = this.widget.value.substring(this.widget.selectionEnd);
this.widget.value = textBefore + '\n' + textAfter;
this.widget.selectionStart = this.widget.selectionEnd = cursorPosition + 1;
}
});
}
Expand Down
Loading