wormclaude 1.0.133 → 1.0.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/theme.js +1 -1
- package/dist/tui.js +17 -12
- package/package.json +1 -1
package/dist/theme.js
CHANGED
package/dist/tui.js
CHANGED
|
@@ -96,25 +96,30 @@ export async function runTui() {
|
|
|
96
96
|
const inner = Math.max(4, W - 2); // "✶ " önek payı
|
|
97
97
|
const REV = '\x1b[7m', UNREV = '\x1b[27m'; // ters-video blok imleç
|
|
98
98
|
// Karakterleri hücreye çevir; imleçteki karakter ters-video (sondaysa boşluk bloğu).
|
|
99
|
-
|
|
100
|
-
const chs = [...inputBuf];
|
|
101
|
-
for (let i = 0; i < chs.length; i++) {
|
|
102
|
-
cells.push({ s: i === inputCur ? REV + chs[i] + UNREV : chs[i], w: stringWidth(chs[i]) || 1 });
|
|
103
|
-
}
|
|
104
|
-
if (inputCur >= chs.length)
|
|
105
|
-
cells.push({ s: REV + ' ' + UNREV, w: 1 });
|
|
106
|
-
// Genişliğe göre sar.
|
|
99
|
+
// Karakterleri genişliğe göre sar; YAPIŞTIRILAN newline (\n) = sert satır kırma.
|
|
107
100
|
const wrapped = [];
|
|
101
|
+
const chs = [...inputBuf];
|
|
108
102
|
let cur = '', w = 0;
|
|
109
|
-
for (
|
|
110
|
-
if (
|
|
103
|
+
for (let i = 0; i < chs.length; i++) {
|
|
104
|
+
if (chs[i] === '\n') { // çok-satır yapıştırma satır sonu
|
|
105
|
+
if (i === inputCur)
|
|
106
|
+
cur += REV + ' ' + UNREV;
|
|
107
|
+
wrapped.push(cur);
|
|
108
|
+
cur = '';
|
|
109
|
+
w = 0;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const cw = stringWidth(chs[i]) || 1;
|
|
113
|
+
if (w + cw > inner) {
|
|
111
114
|
wrapped.push(cur);
|
|
112
115
|
cur = '';
|
|
113
116
|
w = 0;
|
|
114
117
|
}
|
|
115
|
-
cur +=
|
|
116
|
-
w +=
|
|
118
|
+
cur += (i === inputCur ? REV + chs[i] + UNREV : chs[i]);
|
|
119
|
+
w += cw;
|
|
117
120
|
}
|
|
121
|
+
if (inputCur >= chs.length)
|
|
122
|
+
cur += REV + ' ' + UNREV;
|
|
118
123
|
wrapped.push(cur);
|
|
119
124
|
if (wrapped.length <= MAX_INPUT_LINES) {
|
|
120
125
|
return wrapped.map((ln, i) => (i === 0 ? paint('✶ ', theme.redBright, true) : ' ') + paint(ln, theme.white));
|