From e097b88dab538705c7b165cf3a1f5cf3a74a23bb Mon Sep 17 00:00:00 2001 From: nibon7 Date: Sun, 24 Dec 2023 00:52:40 +0800 Subject: [PATCH] Fix `prompt_start_row` reset to 0 after output without CR (#688) --- src/painting/painter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/painting/painter.rs b/src/painting/painter.rs index bee86429..4ee076ec 100644 --- a/src/painting/painter.rs +++ b/src/painting/painter.rs @@ -153,7 +153,7 @@ impl Painter { // This might not be terribly performant. Testing it out let is_reset = || match cursor::position() { - Ok(position) => position.1 < self.prompt_start_row, + Ok(position) => position.1.abs_diff(self.prompt_start_row) > 1, Err(_) => false, };