Preserve cursor poistion on resize
This commit is contained in:
parent
be5a1e69a8
commit
7103e6f659
1 changed files with 7 additions and 1 deletions
|
|
@ -136,7 +136,13 @@ def resize(self, lines: int, columns: int):
|
|||
self.tophistorybuf.extend(self.linebuf[:extra])
|
||||
del self.linebuf[:extra]
|
||||
self.margins = Margins(0, self.lines - 1)
|
||||
self.reset_mode(mo.DECOM)
|
||||
self._notify_cursor_position = False
|
||||
try:
|
||||
x, y = self.cursor.x, self.cursor.y
|
||||
self.reset_mode(mo.DECOM)
|
||||
self.cursor.x, self.cursor.y = x, y
|
||||
finally:
|
||||
self._notify_cursor_position = True
|
||||
self.ensure_bounds()
|
||||
|
||||
def set_margins(self, top=None, bottom=None):
|
||||
|
|
|
|||
Loading…
Reference in a new issue