codemaxxing 1.0.7 → 1.0.8
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/index.js +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1772,7 +1772,7 @@ function pasteLog(msg) {
|
|
|
1772
1772
|
}
|
|
1773
1773
|
const origEmit = process.stdin.emit.bind(process.stdin);
|
|
1774
1774
|
function handlePasteContent(content) {
|
|
1775
|
-
const normalized = content.replace(/\r\n/g, "\n").trim();
|
|
1775
|
+
const normalized = content.replace(/\r\n/g, "\n").replace(/\r/g, "\n").trim();
|
|
1776
1776
|
if (!normalized)
|
|
1777
1777
|
return;
|
|
1778
1778
|
const lineCount = normalized.split("\n").length;
|
|
@@ -1789,8 +1789,10 @@ function handlePasteContent(content) {
|
|
|
1789
1789
|
}
|
|
1790
1790
|
function looksLikeMultilinePaste(data) {
|
|
1791
1791
|
const clean = data.replace(/\x1b\[[0-9;]*[A-Za-z]/g, ""); // Strip all ANSI escapes
|
|
1792
|
-
|
|
1793
|
-
const
|
|
1792
|
+
// Count \r\n, \n, and bare \r as line breaks (macOS terminals often use bare \r)
|
|
1793
|
+
const normalized = clean.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
1794
|
+
const newlines = (normalized.match(/\n/g) ?? []).length;
|
|
1795
|
+
const printable = normalized.replace(/\n/g, "").trim().length;
|
|
1794
1796
|
return newlines >= 2 || (newlines >= 1 && printable >= 40);
|
|
1795
1797
|
}
|
|
1796
1798
|
function flushBurst() {
|