boon

unix terminal framework
git clone https://git.ce9e.org/boon.git

commit
ba5aa2bb59da676e3dfa63d7f33beade09ee55c3
parent
14388cf4a7106f4a7e6b63d9ac1d31f83b32a4c0
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-07-11 17:47
do not reverse x,y order

Diffstat

M boon.py 6 +++---

1 files changed, 3 insertions, 3 deletions


diff --git a/boon.py b/boon.py

@@ -93,7 +93,7 @@ def getch(timeout=0.5):
   93    93 		return os.read(fd, 8).decode('ascii')
   94    94 
   95    95 
   96    -1 def cursor_move(x, y):
   -1    96 def cursor_move(y, x):
   97    97 	sys.stdout.write(get_cap('cup', y, x))
   98    98 
   99    99 
@@ -107,12 +107,12 @@ class App:
  107   107 		for i, line in enumerate(lines):
  108   108 			if len(self.old_lines) > i and line == self.old_lines[i]:
  109   109 				continue
  110    -1 			cursor_move(0, i)
   -1   110 			cursor_move(i, 0)
  111   111 			sys.stdout.write(get_cap('el'))
  112   112 			sys.stdout.write(line)
  113   113 
  114   114 		# clear rest of screen
  115    -1 		cursor_move(0, len(lines))
   -1   115 		cursor_move(len(lines), 0)
  116   116 		sys.stdout.write(get_cap('ed'))
  117   117 		sys.stdout.flush()
  118   118