1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00

avoid repeated emission of cursor updates when scrolled back

This commit is contained in:
Wez Furlong 2019-06-20 21:39:47 -07:00
parent 938eb5e1cf
commit 130a7263d4

View File

@ -439,10 +439,14 @@ impl ClientSurfaceState {
let (x, y) = self.surface.cursor_position();
let cursor = renderable.get_cursor_position();
if (x != cursor.x) || (y as i64 != cursor.y) {
self.surface.add_change(Change::CursorPosition {
x: Position::Absolute(cursor.x),
y: Position::Absolute(cursor.y as usize),
});
// Update the cursor, but if we're scrolled back
// and it is our of range, skip the update.
if cursor.y < rows as i64 {
self.surface.add_change(Change::CursorPosition {
x: Position::Absolute(cursor.x),
y: Position::Absolute(cursor.y as usize),
});
}
}
let mut changes = vec![];