From e96f66c495e277e2437c7f6cb7665b8ec920cae7 Mon Sep 17 00:00:00 2001 From: 4thCafe Date: Fri, 17 Jul 2026 06:56:05 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=8F=E3=82=A4=E3=83=A9=E3=82=A4=E3=83=88?= =?UTF-8?q?=E3=81=AE=E8=83=8C=E6=99=AF=E8=89=B2=E3=82=92=E5=BE=A9=E6=B4=BB?= =?UTF-8?q?=E3=83=BB=E6=9C=AB=E5=B0=BE=E3=82=AB=E3=83=B3=E3=83=9E=E3=82=92?= =?UTF-8?q?=E4=BF=9D=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 構文ハイライトでtextareaを透明化した際に黒背景が消えていたのを修正 (背景をバックドロップ側に持たせる) - 末尾のカンマ(,)を記憶し、チップ操作後もプロンプト末尾に維持 Co-Authored-By: Claude Fable 5 --- js/highlighter.js | 3 +++ js/tag_editor.js | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/js/highlighter.js b/js/highlighter.js index 79dd640..d0e382c 100644 --- a/js/highlighter.js +++ b/js/highlighter.js @@ -62,10 +62,13 @@ export class Highlighter { const parent = ta.parentElement; const cs = getComputedStyle(ta); this._origColor = cs.color; + const origBg = cs.backgroundColor; const bd = document.createElement("div"); bd.className = "pte-hl-backdrop"; const s = bd.style; + // 背景はバックドロップ側に持たせる(textareaを透明化すると黒背景が消えるため) + s.background = origBg && origBg !== "rgba(0, 0, 0, 0)" ? origBg : "var(--comfy-input-bg, #222)"; s.position = "absolute"; s.margin = "0"; s.borderWidth = cs.borderWidth; diff --git a/js/tag_editor.js b/js/tag_editor.js index a5f7fd8..128fd2f 100644 --- a/js/tag_editor.js +++ b/js/tag_editor.js @@ -24,18 +24,22 @@ export class TagEditor { this.tokens = []; this.editing = false; // inline編集中(逆同期抑制用) this._dragIndex = -1; + this._trailingSep = ""; // 末尾のカンマ(+空白)を保持 this.container.classList.add("pte-chips"); } // 外部の文字列からチップを再構築(逆同期時) setFromString(str) { if (this.editing) return; // 編集中は再構築しない + // 末尾のカンマ(全角/半角+空白)を記憶し、チップ操作後も維持する + const m = (str || "").match(/[,,][ \t]*$/); + this._trailingSep = m ? m[0] : ""; this.tokens = tokenize(str); this.render(); } _emit() { - this.onChange(serialize(this.tokens)); + this.onChange(serialize(this.tokens) + this._trailingSep); } _emitAndRender() {