Skip to content
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

Print rest of line after cursor with large completion menu #700

Merged
merged 1 commit into from
Jan 11, 2024
Merged
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
6 changes: 6 additions & 0 deletions src/painting/painter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
if let Some(menu) = menu {
// TODO: Also solve the difficult problem of displaying (parts of)
// the content after the cursor with the completion menu
// This only shows the rest of the line the cursor is on
if let Some(newline) = lines.after_cursor.find('\n') {
self.stdout.queue(Print(&lines.after_cursor[0..newline]))?;

Check warning on line 394 in src/painting/painter.rs

View check run for this annotation

Codecov / codecov/patch

src/painting/painter.rs#L393-L394

Added lines #L393 - L394 were not covered by tests
} else {
self.stdout.queue(Print(&lines.after_cursor))?;

Check warning on line 396 in src/painting/painter.rs

View check run for this annotation

Codecov / codecov/patch

src/painting/painter.rs#L396

Added line #L396 was not covered by tests
}
self.print_menu(menu, lines, use_ansi_coloring)?;
} else {
// Selecting lines for the hint
Expand Down