mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-11 18:32:12 +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:
@@ -217,13 +217,13 @@ class TestScreen(BaseTest):
|
||||
s = self.create_screen(scrollback=6)
|
||||
s.draw(''.join([str(i) * s.columns for i in range(s.lines)]))
|
||||
s.resize(3, 10)
|
||||
self.ae(str(s.line(0)), '2'*5 + '3'*5)
|
||||
self.ae(str(s.line(1)), '4'*5)
|
||||
self.ae(str(s.line(2)), ''*5)
|
||||
self.ae(str(s.line(0)), '0'*5 + '1'*5)
|
||||
self.ae(str(s.line(1)), '2'*5 + '3'*5)
|
||||
self.ae(str(s.line(2)), '4'*5)
|
||||
s.resize(5, 1)
|
||||
self.ae(str(s.line(0)), '4')
|
||||
hb = s.historybuf
|
||||
self.ae(str(hb), '4\n3\n3\n3\n3\n3')
|
||||
self.ae(str(hb), '3\n3\n3\n3\n3\n2')
|
||||
s = self.create_screen(scrollback=20)
|
||||
s.draw(''.join(str(i) * s.columns for i in range(s.lines*2)))
|
||||
self.ae(str(s.linebuf), '55555\n66666\n77777\n88888\n99999')
|
||||
|
||||
Reference in New Issue
Block a user