Merge pull request #15178 from catboxanon/feat/edit-attention-whitespace-trim
edit-attention: deselect surrounding whitespace
This commit is contained in:
commit
8b96f3d036
|
@ -64,6 +64,14 @@ function keyupEditAttention(event) {
|
|||
selectionEnd++;
|
||||
}
|
||||
|
||||
// deselect surrounding whitespace
|
||||
while (text[selectionStart] == " " && selectionStart < selectionEnd) {
|
||||
selectionStart++;
|
||||
}
|
||||
while (text[selectionEnd - 1] == " " && selectionEnd > selectionStart) {
|
||||
selectionEnd--;
|
||||
}
|
||||
|
||||
target.setSelectionRange(selectionStart, selectionEnd);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue