From b080c53ac428d3814a6b1e7eadf63b305818f051 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 1 May 2014 16:40:00 +0200 Subject: Scroll the FormWin when resize moves the current line out of the visible area --- src/tabs/data_forms.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/tabs') 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): """ -- cgit v1.2.3