diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-13 12:21:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 12:21:39 +0000 |
commit | b7c5b30f14aadffadd2d35cb3ecb3e91af00581d (patch) | |
tree | 0e51f517bb6ac010c0e3dc5937d112656ec9ee9a /javascript/edit-attention.js | |
parent | 14501f56aaf3c97fb2c38633350dc747b9651f43 (diff) | |
parent | 262ec8ecdaf10d8fe49d0227e24bd3a1459e87b5 (diff) | |
download | stable-diffusion-webui-gfx803-b7c5b30f14aadffadd2d35cb3ecb3e91af00581d.tar.gz stable-diffusion-webui-gfx803-b7c5b30f14aadffadd2d35cb3ecb3e91af00581d.tar.bz2 stable-diffusion-webui-gfx803-b7c5b30f14aadffadd2d35cb3ecb3e91af00581d.zip |
Merge branch 'dev' into master
Diffstat (limited to 'javascript/edit-attention.js')
-rw-r--r-- | javascript/edit-attention.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/javascript/edit-attention.js b/javascript/edit-attention.js index ffa73147..8906c892 100644 --- a/javascript/edit-attention.js +++ b/javascript/edit-attention.js @@ -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(); |