summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-05-10 00:49:38 +0200
committermathieui <mathieui@mathieui.net>2013-05-10 00:49:38 +0200
commitca8b67fca9448b2082a07b55c799b852f32fa623 (patch)
tree76574782429943aed95adf41f4fcd4f76ef1192d /src
parent60388686a5f1fcc67638a139b4194eb6afe909e4 (diff)
downloadpoezio-ca8b67fca9448b2082a07b55c799b852f32fa623.tar.gz
poezio-ca8b67fca9448b2082a07b55c799b852f32fa623.tar.bz2
poezio-ca8b67fca9448b2082a07b55c799b852f32fa623.tar.xz
poezio-ca8b67fca9448b2082a07b55c799b852f32fa623.zip
Fix #2131 (Input cursor when pasting text)
Diffstat (limited to 'src')
-rw-r--r--src/core.py1
-rw-r--r--src/windows.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core.py b/src/core.py
index ea927af4..6766ef6a 100644
--- a/src/core.py
+++ b/src/core.py
@@ -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()]
diff --git a/src/windows.py b/src/windows.py
index 5e1fc06c..49e76ff5 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -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):