Skip to content

Commit

Permalink
fix: misaligned error display in skctl xray
Browse files Browse the repository at this point in the history
  • Loading branch information
drmorr0 committed Nov 30, 2024
1 parent 7b7fb4a commit 71a5eee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions sk-cli/src/xray/view/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ pub(super) fn format_list_entries<'a>(
// error is present we create a separate span here.
let (trunc_width, right_padding_width) = match err_span.width() {
0 => (width - LIST_PADDING, 0),
x => (
width - (mid_padding_width + max_err_width + max_err_width - x + LIST_PADDING + LIST_PADDING),
max_err_width - x + LIST_PADDING,
),
x => (width - (mid_padding_width + max_err_width + LIST_PADDING), max_err_width - x + LIST_PADDING),
};
let right_padding_span = Span::styled(" ".repeat(right_padding_width), err_span.style);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
source: sk-cli/src/xray/tests/view_test.rs
source: sk-cli/src/xray/view/tests/view_test.rs
expression: cf
---
CompletedFrame {
Expand All @@ -11,7 +11,7 @@ CompletedFrame {
"│ 00:00:01 (1 applied/0 deleted) │",
"│>> 00:00:02 (3 applied/0 deleted) 1 error/0 warnings │",
"│++ + test-namespace/test_depl1 │",
"│ + test-namespace/test_depl2xxxxxxxxxxxxxxxxxxx... 1 error/0 warnings ",
"│ + test-namespace/test_depl2xxxxxxxxxxxxxxxxxxxxxx... 1 error/0 warnings │",
"│ + test-namespace/test_depl3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... │",
"│ 00:00:03 (0 applied/1 deleted) │",
"│ │",
Expand All @@ -37,7 +37,7 @@ CompletedFrame {
x: 33, y: 4, fg: Reset, bg: Blue, underline: Reset, modifier: NONE,
x: 79, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,
x: 4, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: ITALIC,
x: 56, y: 5, fg: White, bg: Red, underline: Reset, modifier: NONE,
x: 59, y: 5, fg: White, bg: Red, underline: Reset, modifier: NONE,
x: 79, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,
x: 4, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: ITALIC,
x: 79, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,
Expand Down

0 comments on commit 71a5eee

Please sign in to comment.