summaryrefslogtreecommitdiff
path: root/src/windows.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-10-21 00:41:50 +0200
committerFlorent Le Coz <louiz@louiz.org>2013-10-21 00:41:50 +0200
commite02f93a8ef9d41e0d3c34bbb076eb6db928afac7 (patch)
tree83b0db54c8b5913e10198069ed4188d9e7039731 /src/windows.py
parent32308646de42ae11f60177d795dffe8e3070a961 (diff)
downloadpoezio-e02f93a8ef9d41e0d3c34bbb076eb6db928afac7.tar.gz
poezio-e02f93a8ef9d41e0d3c34bbb076eb6db928afac7.tar.bz2
poezio-e02f93a8ef9d41e0d3c34bbb076eb6db928afac7.tar.xz
poezio-e02f93a8ef9d41e0d3c34bbb076eb6db928afac7.zip
Increase the number of chars to "jump" when the cursor goes out of the input
Diffstat (limited to 'src/windows.py')
-rw-r--r--src/windows.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/windows.py b/src/windows.py
index 47bc09cf..bd6c32bc 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -1625,11 +1625,15 @@ class Input(Win):
self.view_pos = 0
return
if self.pos < self.view_pos:
- self.view_pos = self.pos - 6
- if self.pos > self.view_pos + self.width:
- self.view_pos = self.pos - self.width + 6
- assert(self.view_pos > 0 and
- self.pos > self.view_pos and
+ if self.width <= 25:
+ self.view_pos = self.pos - self.width
+ else:
+ self.view_pos = self.pos - 25
+ if self.pos >= self.view_pos + self.width - 1:
+ self.view_pos = self.pos - self.width + 12
+ if self.view_pos < 0:
+ self.view_pos = 0
+ assert(self.pos > self.view_pos and
self.pos < self.view_pos + self.width)
def refresh(self):