Commit ca8b67fc authored by mathieui's avatar mathieui

Fix #2131 (Input cursor when pasting text)

parent 60388686
......@@ -395,6 +395,7 @@ class Core(object):
if current:
res.append(current)
return res
while self.running:
big_char_list = [replace_key_with_bound(key)\
for key in self.read_keyboard()]
......
......@@ -1437,9 +1437,8 @@ class Input(Win):
if reset:
self.reset_completion()
self.text = self.text[:self.pos+self.line_pos]+key+self.text[self.pos+self.line_pos:]
(y, x) = self._win.getyx()
for i in range(len(key)):
if x == self.width-1:
if self.pos >= self.width-1:
self.line_pos += 1 # wcwidth.wcswidth(key)
else:
self.pos += 1 # wcwidth.wcswidth(key)
......@@ -1447,6 +1446,7 @@ class Input(Win):
self.rewrite_text()
if self.on_input:
self.on_input(self.get_text())
return True
def add_line_break(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment