mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-01-05 16:51:21 -08:00
Correctly remove end parenthesis with ctrl+up/down
This commit is contained in:
parent
394ffa7b0a
commit
0b0767939d
1 changed files with 3 additions and 2 deletions
|
|
@ -100,11 +100,12 @@ function keyupEditAttention(event) {
|
|||
if (String(weight).length == 1) weight += ".0";
|
||||
|
||||
if (closeCharacter == ')' && weight == 1) {
|
||||
text = text.slice(0, selectionStart - 1) + text.slice(selectionStart, selectionEnd) + text.slice(selectionEnd + 5);
|
||||
var endParenPos = text.substring(selectionEnd).indexOf(')');
|
||||
text = text.slice(0, selectionStart - 1) + text.slice(selectionStart, selectionEnd) + text.slice(selectionEnd + endParenPos + 1);
|
||||
selectionStart--;
|
||||
selectionEnd--;
|
||||
} else {
|
||||
text = text.slice(0, selectionEnd + 1) + weight + text.slice(selectionEnd + 1 + end - 1);
|
||||
text = text.slice(0, selectionEnd + 1) + weight + text.slice(selectionEnd + end);
|
||||
}
|
||||
|
||||
target.focus();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue