mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-15 14:50:55 -08:00
fix the situation with emphasis editing (aaaa:1.1) bbbb (cccc:1.1)
This commit is contained in:
parent
384fab9627
commit
464fbcd921
1 changed files with 6 additions and 0 deletions
|
|
@ -19,11 +19,17 @@ function keyupEditAttention(event) {
|
|||
let beforeParen = before.lastIndexOf(OPEN);
|
||||
if (beforeParen == -1) return false;
|
||||
|
||||
let beforeClosingParen = before.lastIndexOf(CLOSE);
|
||||
if (beforeClosingParen != -1 && beforeClosingParen > beforeParen) return false;
|
||||
|
||||
// Find closing parenthesis around current cursor
|
||||
const after = text.substring(selectionStart);
|
||||
let afterParen = after.indexOf(CLOSE);
|
||||
if (afterParen == -1) return false;
|
||||
|
||||
let afterOpeningParen = after.indexOf(OPEN);
|
||||
if (afterOpeningParen != -1 && afterOpeningParen < beforeParen) return false;
|
||||
|
||||
// Set the selection to the text between the parenthesis
|
||||
const parenContent = text.substring(beforeParen + 1, selectionStart + afterParen);
|
||||
if (/.*:-?[\d.]+/s.test(parenContent)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue