termwiz: windows: fix bounds check for cursor positioning
This commit is contained in:
1 parent
58c07b6da0
commit
03ab5ea659
1 file changed
+2
-2
@@ -230,8 +230,8 @@ impl ScreenBuffer {
|
||||
out.flush()?;
|
||||
let info = out.get_buffer_info()?;
|
||||
out.set_cursor_position(
|
||||
self.cursor_x as i16,
|
||||
self.cursor_y as i16 + info.srWindow.Top,
|
||||
self.cursor_x.min(self.cols - 1) as i16,
|
||||
(self.cursor_y as i16 + info.srWindow.Top).min(self.rows as i16 - 1),
|
||||
)?;
|
||||
out.flush()?;
|
||||
out.set_attr(self.pending_attr)?;
|
||||
|
||||
Reference in new issue
Block a user