mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-02-04 06:42:13 -08:00
edit-attention: deselect surrounding whitespace
This commit is contained in:
parent
58f7410c9d
commit
766f6e3eca
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue