summaryrefslogtreecommitdiff
path: root/src/tabs/data_forms.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-01 16:40:00 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-01 16:40:00 +0200
commitb080c53ac428d3814a6b1e7eadf63b305818f051 (patch)
treede428196a9ea154e8e1fc53bb13a7e137cad07f9 /src/tabs/data_forms.py
parent16d80a2f253fef50183336fbbc46d6d1f199d7d2 (diff)
downloadpoezio-b080c53ac428d3814a6b1e7eadf63b305818f051.tar.gz
poezio-b080c53ac428d3814a6b1e7eadf63b305818f051.tar.bz2
poezio-b080c53ac428d3814a6b1e7eadf63b305818f051.tar.xz
poezio-b080c53ac428d3814a6b1e7eadf63b305818f051.zip
Scroll the FormWin when resize moves the current line out of the visible area
Diffstat (limited to 'src/tabs/data_forms.py')
-rw-r--r--src/tabs/data_forms.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tabs/data_forms.py b/src/tabs/data_forms.py
index e873fe25..5f44a8f6 100644
--- a/src/tabs/data_forms.py
+++ b/src/tabs/data_forms.py
@@ -435,6 +435,10 @@ class FormWin(object):
def resize(self, height, width, y, x):
self.height = height
self.width = width
+ # Adjust the scroll position, if resizing made the window too small
+ # for the cursor to be visible
+ while self.current_input - self.scroll_pos > self.height-1:
+ self.scroll_pos += 1
def reply(self):
"""