summaryrefslogtreecommitdiff
path: root/poezio/windows/inputs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-04-16 21:44:02 +0200
committermathieui <mathieui@mathieui.net>2021-04-16 21:52:28 +0200
commit11de2d98b3a734ffcd4641a7c5b7affeb47844f6 (patch)
tree3bb8e3f6c5d249b9802dcf08365ab1cea83fa5b9 /poezio/windows/inputs.py
parente9f6cae5b5d836ff4ccff30d5034d2bf2c0f1271 (diff)
downloadpoezio-11de2d98b3a734ffcd4641a7c5b7affeb47844f6.tar.gz
poezio-11de2d98b3a734ffcd4641a7c5b7affeb47844f6.tar.bz2
poezio-11de2d98b3a734ffcd4641a7c5b7affeb47844f6.tar.xz
poezio-11de2d98b3a734ffcd4641a7c5b7affeb47844f6.zip
fix: take newlines into account when completing stuff
fixes #3385
Diffstat (limited to 'poezio/windows/inputs.py')
-rw-r--r--poezio/windows/inputs.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/poezio/windows/inputs.py b/poezio/windows/inputs.py
index 0d884464..7ee8aa45 100644
--- a/poezio/windows/inputs.py
+++ b/poezio/windows/inputs.py
@@ -409,12 +409,14 @@ class Input(Win):
Normal completion
"""
pos = self.pos
- if pos < len(
- self.text) and after.endswith(' ') and self.text[pos] == ' ':
+ if pos < len(self.text) and after.endswith(' ') and self.text[pos] in ' \n':
after = after[:
-1] # remove the last space if we are already on a space
if not self.last_completion:
space_before_cursor = self.text.rfind(' ', 0, pos)
+ line_before_cursor = self.text.rfind('\n', 0, pos)
+ if line_before_cursor > space_before_cursor:
+ space_before_cursor = line_before_cursor
if space_before_cursor != -1:
begin = self.text[space_before_cursor + 1:pos]
else: