Commit 01e5074
console: use getStringWidth() for character width calculation
This is more accurate for displayed full-width characters
(e.g. CJK ones) and makes the calculations match the ones we
use in the readline module.
Fixes: #29299
PR-URL: #29300
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias NieΓen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 0bd6527 commit 01e5074Copy full SHA for 01e5074
File tree
Expand file treeCollapse file tree
2 files changed
+22
-10
lines changedOpen diff view settings
Filter options
- lib/internal
- test/parallel
Expand file treeCollapse file tree
2 files changed
+22
-10
lines changedOpen diff view settings
Collapse file
βlib/internal/cli_table.jsβ
Copy file name to clipboardExpand all lines: lib/internal/cli_table.js+4-10Lines changed: 4 additions & 10 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2 | 2 | |
3 | 3 | |
4 | 4 | |
5 | | - |
6 | | - |
| 5 | + |
7 | 6 | |
8 | 7 | |
9 | 8 | |
| ||
29 | 28 | |
30 | 29 | |
31 | 30 | |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | 31 | |
38 | 32 | |
39 | 33 | |
40 | 34 | |
41 | | - |
| 35 | + |
42 | 36 | |
43 | 37 | |
44 | 38 | |
| ||
52 | 46 | |
53 | 47 | |
54 | 48 | |
55 | | - |
| 49 | + |
56 | 50 | |
57 | 51 | |
58 | 52 | |
| ||
63 | 57 | |
64 | 58 | |
65 | 59 | |
66 | | - |
| 60 | + |
67 | 61 | |
68 | 62 | |
69 | 63 | |
|
Collapse file
βtest/parallel/test-console-table.jsβ
Copy file name to clipboardExpand all lines: test/parallel/test-console-table.js+18Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
258 | 258 | |
259 | 259 | |
260 | 260 | |
| 261 | + |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
| 268 | + |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
0 commit comments