Fix moving cursor outside a defined page area incorrectly causing the cursor to be placed inside the page area. Caused incorrect rendering in neovim, which relies on this behavior.

Fixes #542
This commit is contained in:
Kovid Goyal
2018-05-19 08:04:37 +05:30
parent 5d4e968f50
commit ba9af3df8c
3 changed files with 26 additions and 10 deletions

View File

@@ -317,6 +317,13 @@ class TestScreen(BaseTest):
c = chr(ord('I') + l - 2)
self.ae(c + ' ' * (s.columns - 2) + c.lower(), str(s.line(l)))
s.reset_mode(DECOM)
# Test that moving cursor outside the margins works as expected
s = self.create_screen(10, 10)
s.set_margins(5, 7)
s.cursor_position(0, 0)
self.ae(s.cursor.y, 0)
nl()
self.ae(s.cursor.y, 1)
def test_sgr(self):
s = self.create_screen()