Commit 082d7e86 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Autocompletion fix when using F8

parent d739c5c1
......@@ -238,8 +238,10 @@ class EditableText(QGraphicsTextItem, object):
text_cursor.setPosition(self.cursor_position)
extra = len(item.text()) - len(self.completion_prefix)
if extra > 0:
text_cursor.movePosition(QTextCursor.Left)
text_cursor.movePosition(QTextCursor.EndOfWord)
if len(self.completion_prefix):
# Move back left only if there is a word to replace
text_cursor.movePosition(QTextCursor.Left)
text_cursor.movePosition(QTextCursor.EndOfWord)
text_cursor.insertText(item.text()[-extra:])
self.setTextCursor(text_cursor)
self.completer_has_focus = False
......
Supports Markdown
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