Commit 766f6e3e authored by catboxanon's avatar catboxanon Committed by GitHub

edit-attention: deselect surrounding whitespace

parent 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% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment