Merge pull request #15178 from catboxanon/feat/edit-attention-whitespace-trim

edit-attention: deselect surrounding whitespace
This commit is contained in:
AUTOMATIC1111
2024-03-08 06:21:24 +03:00
committed by GitHub

View File

@@ -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;
}