Simpler comparison

Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>
This commit is contained in:
catboxanon 2024-03-07 21:30:05 -05:00 committed by GitHub
parent 766f6e3eca
commit 5ab5405b6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,10 +65,10 @@ function keyupEditAttention(event) {
}
// deselect surrounding whitespace
while (target.value.slice(selectionStart, selectionStart + 1) == " " && selectionStart < selectionEnd) {
while (text[selectionStart] == " " && selectionStart < selectionEnd) {
selectionStart++;
}
while (target.value.slice(selectionEnd - 1, selectionEnd) == " " && selectionEnd > selectionStart) {
while (text[selectionEnd - 1] == " " && selectionEnd > selectionStart) {
selectionEnd--;
}