Print after cursor until newline (#700)

This commit is contained in:
Yash Thakur 2024-01-11 10:29:07 -05:00 committed by GitHub
parent 7404f70bf7
commit 3e2c0fef3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -389,6 +389,12 @@ impl Painter {
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]))?;
} else {
self.stdout.queue(Print(&lines.after_cursor))?;
}
self.print_menu(menu, lines, use_ansi_coloring)?;
} else {
// Selecting lines for the hint