Skip to content

Commit e4221b9

Browse files
qilmeBahex
andauthored
fix: adjust cursor start position for large buffers (#900)
* fix: adjust cursor start position for large buffers * fix: include prompt+cmdline heights in calculating cursor start position --------- Co-authored-by: Bahex <17417311+Bahex@users.noreply.github.com>
1 parent 7c77f5b commit e4221b9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/painting/painter.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ impl Painter {
243243

244244
// Moving the start position of the cursor based on the size of the required lines
245245
if self.large_buffer || is_reset() {
246+
for _ in 0..screen_height - lines.required_lines(screen_width, None) {
247+
self.stdout.queue(Print(&coerce_crlf("\n")))?;
248+
}
246249
self.prompt_start_row = 0;
247250
} else if required_lines >= remaining_lines {
248251
let extra = required_lines.saturating_sub(remaining_lines);

0 commit comments

Comments
 (0)