Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Commit

Permalink
Do not let _cap_cub1 move the cursor one line up
Browse files Browse the repository at this point in the history
It fixes #72.
  • Loading branch information
eugulixes authored and Dmitriy Shilin committed Feb 28, 2017
1 parent b5c8f14 commit e28ef67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
5 changes: 0 additions & 5 deletions gits/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,6 @@ def _cap_cub1(self):
"""
self._cur_x = max(0, self._cur_x - 1)

if self._cur_x == self._left_most:
self._cur_x = self._right_most
self._cur_y = max(0, self._cur_y - 1)
self._eol = True

def _cap_cud(self, n):
"""Moves the cursor down ``n`` number of lines. """
self._cur_y = min(self._bottom_most, self._cur_y + n)
Expand Down
9 changes: 2 additions & 7 deletions gits/test/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,8 @@ def _check_cap_cub1(self, pos):

term._cap_cub1()

if cur_x <= 1:
self.assertEqual(term._right_most, term._cur_x)

if cur_y == 0:
self.assertEqual(0, term._cur_y)
else:
self.assertEqual(cur_y - 1, term._cur_y)
if cur_x == 0:
self.assertEqual(term._left_most, term._cur_x)
else:
self.assertEqual(cur_x - 1, term._cur_x)
self.assertEqual(cur_y, term._cur_y)
Expand Down

0 comments on commit e28ef67

Please sign in to comment.