未验证 提交 766f6e3e 编写于 作者: C catboxanon 提交者: GitHub

edit-attention: deselect surrounding whitespace

上级 58f7410c
......@@ -64,6 +64,14 @@ function keyupEditAttention(event) {
selectionEnd++;
}
// deselect surrounding whitespace
while (target.value.slice(selectionStart, selectionStart + 1) == " " && selectionStart < selectionEnd) {
selectionStart++;
}
while (target.value.slice(selectionEnd - 1, selectionEnd) == " " && selectionEnd > selectionStart) {
selectionEnd--;
}
target.setSelectionRange(selectionStart, selectionEnd);
return true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册