summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-12-17 21:22:21 +0100
committermathieui <mathieui@mathieui.net>2014-12-17 21:22:21 +0100
commit596f269621f575d84ca95b6328159577dbb3f436 (patch)
tree47d2cc0d60818b6c15547a1203aa5fb522a336e9 /src
parent92265678dc05edc5ad0a50fc69046db6acb05b9f (diff)
downloadpoezio-596f269621f575d84ca95b6328159577dbb3f436.tar.gz
poezio-596f269621f575d84ca95b6328159577dbb3f436.tar.bz2
poezio-596f269621f575d84ca95b6328159577dbb3f436.tar.xz
poezio-596f269621f575d84ca95b6328159577dbb3f436.zip
Fix scrolling inside the input when the text is small enough to fit
(e.g. during a completion, the input might scroll due to the length of the completed item, and not go back to its original state without this change)
Diffstat (limited to 'src')
-rw-r--r--src/windows/inputs.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/windows/inputs.py b/src/windows/inputs.py
index d345443b..2cf719ba 100644
--- a/src/windows/inputs.py
+++ b/src/windows/inputs.py
@@ -534,6 +534,11 @@ class Input(Win):
if self.view_pos < 0:
self.view_pos = 0
+ # text small enough to fit inside the window entirely:
+ # remove scrolling if present
+ if poopt.wcswidth(self.text) < self.width:
+ self.view_pos = 0
+
assert(self.pos >= self.view_pos and
self.pos <= self.view_pos + max(self.width, 3))