Skip to content

fix: Continue suggestion window if there are more elements #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ impl Renderer {
primary_path.or(og_primary_path),
matches_previous_suggestion,
is_first,
//matches!(peek, Some(Element::Message(_) | Element::Padding(_))),
peek.is_some(),
);

if matches!(peek, Some(Element::Suggestion(_))) {
Expand Down Expand Up @@ -1619,6 +1621,7 @@ impl Renderer {
primary_path: Option<&Cow<'_, str>>,
matches_previous_suggestion: bool,
is_first: bool,
is_cont: bool,
) {
let suggestions = sm.splice_lines(suggestion.markers.clone());

Expand Down Expand Up @@ -2010,7 +2013,11 @@ impl Renderer {
| DisplaySuggestion::Underline => row_num - 1,
DisplaySuggestion::None => row_num,
};
self.draw_col_separator_end(buffer, row, max_line_num_len + 1);
if is_cont {
self.draw_col_separator_no_space(buffer, row, max_line_num_len + 1);
} else {
self.draw_col_separator_end(buffer, row, max_line_num_len + 1);
}
row_num = row + 1;
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/rustc_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4071,7 +4071,7 @@ LL + use std::collections::binary_heap::IntoIter;
LL + use std::collections::btree_map::IntoIter;
├╴
LL + use std::collections::btree_set::IntoIter;
╰╴
╰ and 9 other candidates
"#]];
let renderer = renderer.theme(OutputTheme::Unicode);
Expand Down Expand Up @@ -4392,7 +4392,7 @@ LL - wtf: None,
LL - x: (),
LL - })),
LL + wtf: Some(Box::new_in(_, _)),
╰╴
╰ and 12 other candidates
help: consider using the `Default` trait
╭╴
Expand Down Expand Up @@ -4528,7 +4528,7 @@ LL │ t.a1.bar();
LL │ t.a2.bar();
├╴ +++
LL │ t.a3.bar();
╰╴ +++
+++
╰ and 6 other candidates
"#]];
let renderer = renderer.theme(OutputTheme::Unicode);
Expand Down
Loading