@skillre/dsh-plugin-sticky-wall 0.9.5 → 0.9.6
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/lib/client.js +8 -16
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1448,27 +1448,19 @@ window.__ModuleLoader__.load({
|
|
|
1448
1448
|
for (const char of prefix) width += char === " " ? INDENT_WIDTH2 : 1;
|
|
1449
1449
|
return width;
|
|
1450
1450
|
}
|
|
1451
|
-
|
|
1452
|
-
let sawIndent = false;
|
|
1453
|
-
for (const line of value.split("\n")) {
|
|
1454
|
-
if (line.trim() === "") continue;
|
|
1455
|
-
const columns2 = columnsOf(leadingSpace(line));
|
|
1456
|
-
if (columns2 === 0) continue;
|
|
1457
|
-
sawIndent = true;
|
|
1458
|
-
if (columns2 % WIDE_INDENT_UNIT !== 0) return INDENT_WIDTH2;
|
|
1459
|
-
}
|
|
1460
|
-
return sawIndent ? WIDE_INDENT_UNIT : INDENT_WIDTH2;
|
|
1461
|
-
}
|
|
1462
|
-
var WIDE_INDENT_UNIT = 4;
|
|
1451
|
+
var INDENT_STEP = INDENT_WIDTH2;
|
|
1463
1452
|
function indentSelection(value, start, end, direction) {
|
|
1464
|
-
const unit2 = indentUnitOf(value);
|
|
1465
1453
|
return rewriteLines(value, start, end, (line) => {
|
|
1466
1454
|
if (line.trim() === "") return line;
|
|
1467
1455
|
const prefix = leadingSpace(line);
|
|
1468
1456
|
const body = line.slice(prefix.length);
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1457
|
+
const columns2 = columnsOf(prefix);
|
|
1458
|
+
if (direction === 1) {
|
|
1459
|
+
const level2 = Math.floor(columns2 / INDENT_STEP);
|
|
1460
|
+
return `${" ".repeat((level2 + 1) * INDENT_STEP)}${body}`;
|
|
1461
|
+
}
|
|
1462
|
+
const level = Math.ceil(columns2 / INDENT_STEP);
|
|
1463
|
+
return `${" ".repeat(Math.max(0, level - 1) * INDENT_STEP)}${body}`;
|
|
1472
1464
|
});
|
|
1473
1465
|
}
|
|
1474
1466
|
function fenceLines(lines) {
|