Jump to end of line for ul, ol and quote when line is empty (#33958).

Patch by Felix Gliesche.


git-svn-id: http://svn.redmine.org/redmine/trunk@20009 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2020-09-08 06:48:34 +00:00
parent 086a0e00b2
commit 0c23c70edd

View File

@@ -338,7 +338,7 @@ jsToolBar.prototype = {
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") {
this.textarea.value = this.textarea.value.substring(0, start) + subst +
this.textarea.value.substring(end);
if (sel) {
if (sel || (!prefix && start === end)) {
this.textarea.setSelectionRange(start + subst.length, start + subst.length);
} else {
this.textarea.setSelectionRange(start + prefix.length, start + prefix.length);