Skip to content

Commit ec9af96

Browse files
committed
fix: invalid column on Vim
1 parent efa63b6 commit ec9af96

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

denops/fall/util/mapping.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ function formatMappingHelpPage(
3333
): Page[] {
3434
const operator = " ➙ ";
3535
const spacer = " ";
36-
const lhsWidth = Math.max(...mappings.map(({ lhs }) => lhs.length));
37-
const rhsWidth = Math.max(...mappings.map(({ rhs }) => rhs.length));
36+
const lhsWidth = Math.max(...mappings.map(({ lhs }) => getByteLength(lhs)));
37+
const rhsWidth = Math.max(...mappings.map(({ rhs }) => getByteLength(rhs)));
3838
const columnWidth = Math.min(
3939
width,
4040
lhsWidth + rhsWidth + operator.length + spacer.length,
@@ -58,7 +58,7 @@ function formatMappingHelpPage(
5858
const content = [...range(0, height)]
5959
.map((_, i) => {
6060
return columns
61-
.map((column) => column[i] ?? "")
61+
.map((column) => column[i] ?? " ".repeat(columnWidth))
6262
.join(spacer);
6363
})
6464
.filter((c) => c.trim() !== "");

0 commit comments

Comments
 (0)