mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
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
Block a user