diff --git a/scm-record/src/ui.rs b/scm-record/src/ui.rs index dd171023c..c6a9d22b3 100644 --- a/scm-record/src/ui.rs +++ b/scm-record/src/ui.rs @@ -2589,6 +2589,7 @@ impl Component for SectionLineView<'_> { } fn draw(&self, viewport: &mut Viewport, x: isize, y: isize) { + const NEWLINE_ICON: &str = "⏎"; let Self { line_key: _, inner } = self; viewport.fill_rest_of_line(x, y); match inner { @@ -2599,11 +2600,24 @@ impl Component for SectionLineView<'_> { // lines. let line_num_rect = viewport.draw_span(x, y, &Span::styled(format!("{line_num:5} "), style)); - viewport.draw_span( + let (line, line_end) = match line.strip_suffix('\n') { + Some(line) => ( + Span::styled(line, style), + Some(Span::styled( + NEWLINE_ICON, + Style::default().fg(Color::DarkGray), + )), + ), + None => (Span::styled(*line, style), None), + }; + let line_rect = viewport.draw_span( line_num_rect.x + line_num_rect.width.unwrap_isize(), line_num_rect.y, - &Span::styled(*line, style), + &line, ); + if let Some(line_end) = line_end { + viewport.draw_span(line_rect.x + line_rect.width.unwrap_isize(), y, &line_end); + } } SectionLineViewInner::Changed { @@ -2620,7 +2634,20 @@ impl Component for SectionLineView<'_> { }; viewport.draw_span(x, y, &Span::styled(change_type_text, style)); let x = x + change_type_text.width().unwrap_isize(); - viewport.draw_span(x, y, &Span::styled(*line, style)); + let (line, line_end) = match line.strip_suffix('\n') { + Some(line) => ( + Span::styled(line, style), + Some(Span::styled( + NEWLINE_ICON, + Style::default().fg(Color::DarkGray), + )), + ), + None => (Span::styled(*line, style), None), + }; + let line_rect = viewport.draw_span(x, y, &line); + if let Some(line_end) = line_end { + viewport.draw_span(line_rect.x + line_rect.width.unwrap_isize(), y, &line_end); + } } } } diff --git a/scm-record/tests/test_scm_record.rs b/scm-record/tests/test_scm_record.rs index e229f9a75..47bd98295 100644 --- a/scm-record/tests/test_scm_record.rs +++ b/scm-record/tests/test_scm_record.rs @@ -46,25 +46,25 @@ fn test_select_scroll_into_view() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(scroll_to_first_section, @r###" "[File] [Edit] [Select] [View] " "[~] foo/bar [-]" " (~) Section 1/1 (-)" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " "###); insta::assert_display_snapshot!(scroll_to_second_file, @r###" "[File] [Edit] [Select] [View] " "(×) baz (-)" - " 1 Some leading text 1 " - " 2 Some leading text 2 " + " 1 Some leading text 1⏎ " + " 2 Some leading text 2⏎ " " [×] Section 1/1 [-]" - " [×] - before text 1 " + " [×] - before text 1⏎ " "###); Ok(()) } @@ -92,45 +92,45 @@ fn test_toggle_all() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " - " 23 this is some trailing text " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " + " 23 this is some trailing text⏎ " "[×] baz [-]" - " 1 Some leading text 1 " - " 2 Some leading text 2 " + " 1 Some leading text 1⏎ " + " 2 Some leading text 2⏎ " " [×] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [×] + after text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [×] + after text 2⏎ " "###); insta::assert_display_snapshot!(after, @r###" "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" - " [ ] - before text 1 " - " [ ] - before text 2 " - " [ ] + after text 1 " - " [×] + after text 2 " - " 23 this is some trailing text " + " [ ] - before text 1⏎ " + " [ ] - before text 2⏎ " + " [ ] + after text 1⏎ " + " [×] + after text 2⏎ " + " 23 this is some trailing text⏎ " "[ ] baz [-]" - " 1 Some leading text 1 " - " 2 Some leading text 2 " + " 1 Some leading text 1⏎ " + " 2 Some leading text 2⏎ " " [ ] Section 1/1 [-]" - " [ ] - before text 1 " - " [ ] - before text 2 " - " [ ] + after text 1 " - " [ ] + after text 2 " + " [ ] - before text 1⏎ " + " [ ] - before text 2⏎ " + " [ ] + after text 1⏎ " + " [ ] + after text 2⏎ " "###); Ok(()) } @@ -164,49 +164,49 @@ fn test_toggle_all_uniform() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " "###); insta::assert_display_snapshot!(first_toggle, @r###" "[File] [Edit] [Select] [View] " "(×) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [×] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " "###); insta::assert_display_snapshot!(second_toggle, @r###" "[File] [Edit] [Select] [View] " "( ) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [ ] Section 1/1 [-]" - " [ ] - before text 1 " - " [ ] - before text 2 " - " [ ] + after text 1 " + " [ ] - before text 1⏎ " + " [ ] - before text 2⏎ " + " [ ] + after text 1⏎ " "###); insta::assert_display_snapshot!(third_toggle, @r###" "[File] [Edit] [Select] [View] " "(×) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [×] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " "###); Ok(()) @@ -233,18 +233,18 @@ fn test_quit_dialog_size() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " - " 23 this is some trailing text " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " + " 23 this is some trailing text⏎ " "[×] baz [-]" - " 1 Some leading text 1 " - " 2 Some leading text 2 " + " 1 Some leading text 1⏎ " + " 2 Some leading text 2⏎ " " [×] Section 1/1 [-]" " [×] - before te┌Quit───────────────────────────────────────────────────────┐ " " [×] - before te│You have changes to 2 files. Are you sure you want to quit?│ " @@ -311,32 +311,32 @@ fn test_quit_dialog_keyboard_navigation() -> eyre::Result<()> { "(~) foo/b┌Quit───────────────────────────────────────────────────────┐ (-)" " ⋮│You have changes to 2 files. Are you sure you want to quit?│ " " 18└───────────────────────────────────────────[Go Back]─(Quit)┘ " - " 19 this is some text " - " 20 this is some text " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(expect_c_does_nothing, @r###" "[File] [Edit] [Select] [View] " "(~) foo/b┌Quit───────────────────────────────────────────────────────┐ (-)" " ⋮│You have changes to 2 files. Are you sure you want to quit?│ " " 18└───────────────────────────────────────────[Go Back]─(Quit)┘ " - " 19 this is some text " - " 20 this is some text " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(expect_q_closes_quit_dialog, @r###" "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(expect_ctrl_c_opens_quit_dialog, @r###" "[File] [Edit] [Select] [View] " "(~) foo/b┌Quit───────────────────────────────────────────────────────┐ (-)" " ⋮│You have changes to 2 files. Are you sure you want to quit?│ " " 18└───────────────────────────────────────────[Go Back]─(Quit)┘ " - " 19 this is some text " - " 20 this is some text " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(expect_exited, @""); Ok(()) @@ -388,48 +388,48 @@ fn test_quit_dialog_buttons() -> eyre::Result<()> { "(~) foo/b┌Quit───────────────────────────────────────────────────────┐ (-)" " ⋮│You have changes to 2 files. Are you sure you want to quit?│ " " 18└───────────────────────────────────────────[Go Back]─(Quit)┘ " - " 19 this is some text " - " 20 this is some text " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(expect_left_focuses_go_back_button, @r###" "[File] [Edit] [Select] [View] " "(~) foo/b┌Quit───────────────────────────────────────────────────────┐ (-)" " ⋮│You have changes to 2 files. Are you sure you want to quit?│ " " 18└───────────────────────────────────────────(Go Back)─[Quit]┘ " - " 19 this is some text " - " 20 this is some text " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(expect_left_again_does_not_wrap, @r###" "[File] [Edit] [Select] [View] " "(~) foo/b┌Quit───────────────────────────────────────────────────────┐ (-)" " ⋮│You have changes to 2 files. Are you sure you want to quit?│ " " 18└───────────────────────────────────────────(Go Back)─[Quit]┘ " - " 19 this is some text " - " 20 this is some text " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(expect_back_button_closes_quit_dialog, @r###" "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(expect_right_focuses_quit_button, @r###" "[File] [Edit] [Select] [View] " "(~) foo/b┌Quit───────────────────────────────────────────────────────┐ (-)" " ⋮│You have changes to 2 files. Are you sure you want to quit?│ " " 18└───────────────────────────────────────────[Go Back]─(Quit)┘ " - " 19 this is some text " - " 20 this is some text " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(expect_right_again_does_not_wrap, @r###" "[File] [Edit] [Select] [View] " "(~) foo/b┌Quit───────────────────────────────────────────────────────┐ (-)" " ⋮│You have changes to 2 files. Are you sure you want to quit?│ " " 18└───────────────────────────────────────────[Go Back]─(Quit)┘ " - " 19 this is some text " - " 20 this is some text " + " 19 this is some text⏎ " + " 20 this is some text⏎ " "###); insta::assert_display_snapshot!(expect_exited, @""); Ok(()) @@ -500,20 +500,20 @@ fn test_enter_next() -> eyre::Result<()> { insta::assert_display_snapshot!(first_file_selected, @r###" "[File] [Edit] [Select] [View] " "[×] foo [-]" - " [×] - hello " + " [×] - hello⏎ " "( ) bar (-)" " [ ] Section 1/1 [-]" - " [ ] + world " - " [ ] - hello " + " [ ] + world⏎ " + " [ ] - hello⏎ " "###); insta::assert_display_snapshot!(second_file_selected, @r###" "[File] [Edit] [Select] [View] " "[×] foo [-]" - " [×] - hello " + " [×] - hello⏎ " "(×) bar (-)" " [×] Section 1/1 [-]" - " [×] + world " - " [×] - hello " + " [×] + world⏎ " + " [×] - hello⏎ " "###); Ok(()) } @@ -683,23 +683,23 @@ fn test_abbreviate_unchanged_sections() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "( ) foo (-)" " ⋮ " - " 4 start line 4/6 " - " 5 start line 5/6 " - " 6 start line 6/6 " + " 4 start line 4/6⏎ " + " 5 start line 5/6⏎ " + " 6 start line 6/6⏎ " " [ ] Section 1/2 [-]" - " [ ] + changed " - " 7 middle line 1/7 " - " 8 middle line 2/7 " - " 9 middle line 3/7 " + " [ ] + changed⏎ " + " 7 middle line 1/7⏎ " + " 8 middle line 2/7⏎ " + " 9 middle line 3/7⏎ " " ⋮ " - " 11 middle line 5/7 " - " 12 middle line 6/7 " - " 13 middle line 7/7 " + " 11 middle line 5/7⏎ " + " 12 middle line 6/7⏎ " + " 13 middle line 7/7⏎ " " [ ] Section 2/2 [-]" - " [ ] + changed " - " 14 end line 1/6 " - " 15 end line 2/6 " - " 16 end line 3/6 " + " [ ] + changed⏎ " + " 14 end line 1/6⏎ " + " 15 end line 2/6⏎ " + " 16 end line 3/6⏎ " " ⋮ " " " " " @@ -764,20 +764,20 @@ fn test_no_abbreviate_short_unchanged_sections() -> eyre::Result<()> { insta::assert_display_snapshot!(screenshot, @r###" "[File] [Edit] [Select] [View] " "( ) foo (-)" - " 1 start line 1/2 " - " 2 start line 2/2 " + " 1 start line 1/2⏎ " + " 2 start line 2/2⏎ " " [ ] Section 1/2 [-]" - " [ ] + changed " - " 3 middle line 1/6 " - " 4 middle line 2/6 " - " 5 middle line 3/6 " - " 6 middle line 4/6 " - " 7 middle line 5/6 " - " 8 middle line 6/6 " + " [ ] + changed⏎ " + " 3 middle line 1/6⏎ " + " 4 middle line 2/6⏎ " + " 5 middle line 3/6⏎ " + " 6 middle line 4/6⏎ " + " 7 middle line 5/6⏎ " + " 8 middle line 6/6⏎ " " [ ] Section 2/2 [-]" - " [ ] + changed " - " 9 end line 1/2 " - " 10 end line 2/2 " + " [ ] + changed⏎ " + " 9 end line 1/2⏎ " + " 10 end line 2/2⏎ " " " " " " " @@ -1005,28 +1005,28 @@ fn test_mouse_support() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" "###); insta::assert_display_snapshot!(first_click, @r###" "[File] [Edit] [Select] [View] " "[~] foo/bar [-]" " (~) Section 1/1 (-)" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " "###); insta::assert_display_snapshot!(click_scrolled_item, @r###" "[File] [Edit] [Select] [View] " "[~] foo/bar [-]" " [~] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " ( ) + after text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " ( ) + after text 2⏎ " "###); Ok(()) @@ -1149,35 +1149,35 @@ fn test_mouse_click_wide_line() -> eyre::Result<()> { "( ) foo (-)" " [ ] File mode changed from 0 to 100644 " " [ ] Section 2/2 [-]" - " [ ] - foo " + " [ ] - foo⏎ " "###); insta::assert_display_snapshot!(click_line, @r###" "[File] [Edit] [Select] [View] " "[ ] foo [-]" " [ ] File mode changed from 0 to 100644 " " [ ] Section 2/2 [-]" - " ( ) - foo " + " ( ) - foo⏎ " "###); insta::assert_display_snapshot!(click_line_section, @r###" "[File] [Edit] [Select] [View] " "[ ] foo [-]" " [ ] File mode changed from 0 to 100644 " " ( ) Section 2/2 (-)" - " [ ] - foo " + " [ ] - foo⏎ " "###); insta::assert_display_snapshot!(click_file_mode_section, @r###" "[File] [Edit] [Select] [View] " "[ ] foo [-]" " ( ) File mode changed from 0 to 100644 " " [ ] Section 2/2 [-]" - " [ ] - foo " + " [ ] - foo⏎ " "###); insta::assert_display_snapshot!(click_file, @r###" "[File] [Edit] [Select] [View] " "( ) foo (-)" " [ ] File mode changed from 0 to 100644 " " [ ] Section 2/2 [-]" - " [ ] - foo " + " [ ] - foo⏎ " "###); Ok(()) @@ -1224,7 +1224,7 @@ fn test_mouse_click_dialog_buttons() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "(×) foo (-)" " [×] Section 1/1 [-]" - " [×] - foo " + " [×] - foo⏎ " " " " " "###); @@ -1302,9 +1302,9 @@ fn test_expand() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" "###); insta::assert_display_snapshot!(after_collapse, @r###" @@ -1319,11 +1319,11 @@ fn test_expand() -> eyre::Result<()> { insta::assert_display_snapshot!(after_expand_mouse, @r###" "[File] [Edit] [Select] [View] " "(×) baz (-)" - " 1 Some leading text 1 " - " 2 Some leading text 2 " + " 1 Some leading text 1⏎ " + " 2 Some leading text 2⏎ " " [×] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " "###); Ok(()) @@ -1354,19 +1354,19 @@ fn test_expand_line_noop() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "[~] foo/bar [-]" " [~] Section 1/1 [-]" - " (×) - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " + " (×) - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " "###); insta::assert_display_snapshot!(after_expand_noop, @r###" "[File] [Edit] [Select] [View] " "[~] foo/bar [-]" " [~] Section 1/1 [-]" - " (×) - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " + " (×) - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " "###); Ok(()) @@ -1403,11 +1403,11 @@ fn test_expand_scroll_into_view() -> eyre::Result<()> { insta::assert_display_snapshot!(after_expand, @r###" "[File] [Edit] [Select] [View] " "(×) baz (-)" - " 1 Some leading text 1 " - " 2 Some leading text 2 " + " 1 Some leading text 1⏎ " + " 2 Some leading text 2⏎ " " [×] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " "###); Ok(()) @@ -1437,10 +1437,10 @@ fn test_collapse_select_ancestor() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "[~] foo/bar [-]" " (~) Section 1/1 (-)" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " "###); insta::assert_display_snapshot!(after_collapse, @r###" "[File] [Edit] [Select] [View] " @@ -1492,28 +1492,28 @@ fn test_focus_inner() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "[~] foo/bar [-]" " (~) Section 1/1 (-)" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " "###); insta::assert_display_snapshot!(inner2, @r###" "[File] [Edit] [Select] [View] " "[~] foo/bar [-]" " [~] Section 1/1 [-]" - " (×) - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " + " (×) - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " "###); insta::assert_display_snapshot!(inner3, @r###" "[File] [Edit] [Select] [View] " "[~] foo/bar [-]" " [~] Section 1/1 [-]" - " (×) - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " + " (×) - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " "###); Ok(()) @@ -1555,28 +1555,28 @@ fn test_focus_outer() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "[×] baz [-]" " [×] Section 1/1 [-]" - " [×] - before text 1 " - " (×) - before text 2 " - " [×] + after text 1 " - " [×] + after text 2 " + " [×] - before text 1⏎ " + " (×) - before text 2⏎ " + " [×] + after text 1⏎ " + " [×] + after text 2⏎ " "###); insta::assert_display_snapshot!(outer1, @r###" "[File] [Edit] [Select] [View] " "[×] baz [-]" " (×) Section 1/1 (-)" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [×] + after text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [×] + after text 2⏎ " "###); insta::assert_display_snapshot!(outer2, @r###" "[File] [Edit] [Select] [View] " "(×) baz (-)" - " 1 Some leading text 1 " - " 2 Some leading text 2 " + " 1 Some leading text 1⏎ " + " 2 Some leading text 2⏎ " " [×] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " "###); insta::assert_display_snapshot!(outer3, @r###" "[File] [Edit] [Select] [View] " @@ -1635,55 +1635,55 @@ fn test_sticky_header_scroll() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" "###); insta::assert_display_snapshot!(scroll1, @r###" "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" - " [×] - before text 1 " + " [×] - before text 1⏎ " "###); insta::assert_display_snapshot!(scroll2, @r###" "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" - " 19 this is some text " - " 20 this is some text " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " "###); insta::assert_display_snapshot!(scroll3, @r###" "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" - " 20 this is some text " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " "###); insta::assert_display_snapshot!(scroll4, @r###" "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " [~] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " "###); insta::assert_display_snapshot!(scroll5, @r###" "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [ ] + after text 2 " - " 23 this is some trailing text " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [ ] + after text 2⏎ " + " 23 this is some trailing text⏎ " "###); Ok(()) @@ -1728,19 +1728,19 @@ fn test_sticky_header_click_expand() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "[×] baz [-]" " (×) Section 1/1 (-)" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [×] + after text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [×] + after text 2⏎ " "###); insta::assert_display_snapshot!(after_click1, @r###" "[File] [Edit] [Select] [View] " "(×) baz (-)" " [×] Section 1/1 [-]" - " [×] - before text 1 " - " [×] - before text 2 " - " [×] + after text 1 " - " [×] + after text 2 " + " [×] - before text 1⏎ " + " [×] - before text 2⏎ " + " [×] + after text 1⏎ " + " [×] + after text 2⏎ " "###); insta::assert_display_snapshot!(after_click2, @r###" "[File] [Edit] [Select] [View] " @@ -1778,18 +1778,18 @@ fn test_scroll_click_no_jump() -> eyre::Result<()> { "[File] [Edit] [Select] [View] " "(~) foo/bar (-)" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" "###); insta::assert_display_snapshot!(after_click, @r###" "[File] [Edit] [Select] [View] " "[~] foo/bar [-]" " ⋮ " - " 18 this is some text " - " 19 this is some text " - " 20 this is some text " + " 18 this is some text⏎ " + " 19 this is some text⏎ " + " 20 this is some text⏎ " " [~] Section 1/1 [-]" "###);