mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 11:11:47 +02:00
Track cursor position explicitly during rewrap
Instead of using heuristics to position the cursor after a resize, track the position during re-wrapping and place the cursor at the re-wrapped position. Fixes #242 (I hope)
This commit is contained in:
@@ -279,8 +279,9 @@ void historybuf_rewrap(HistoryBuf *self, HistoryBuf *other) {
|
||||
return;
|
||||
}
|
||||
other->count = 0; other->start_of_data = 0;
|
||||
index_type x = 0, y = 0;
|
||||
if (self->count > 0) {
|
||||
rewrap_inner(self, other, self->count, NULL);
|
||||
rewrap_inner(self, other, self->count, NULL, &x, &y);
|
||||
for (index_type i = 0; i < other->count; i++) other->line_attrs[(other->start_of_data + i) % other->ynum] |= TEXT_DIRTY_MASK;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user