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)
This commit is contained in:
parent
92265678dc
commit
596f269621
1 changed files with 5 additions and 0 deletions
|
@ -534,6 +534,11 @@ class Input(Win):
|
||||||
if self.view_pos < 0:
|
if self.view_pos < 0:
|
||||||
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
|
assert(self.pos >= self.view_pos and
|
||||||
self.pos <= self.view_pos + max(self.width, 3))
|
self.pos <= self.view_pos + max(self.width, 3))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue