From a156ee94bf33cb6bf9fdfcd4180f472c16575210 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sun, 17 Sep 2017 22:03:14 +0300 Subject: [PATCH] paytoedit: fix insertCompletion() string handling --- gui/qt/paytoedit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/qt/paytoedit.py b/gui/qt/paytoedit.py index fda39dd21..7d1a14d6a 100644 --- a/gui/qt/paytoedit.py +++ b/gui/qt/paytoedit.py @@ -209,10 +209,10 @@ class PayToEdit(ScanQRTextEdit): if self.c.widget() != self: return tc = self.textCursor() - extra = completion.length() - self.c.completionPrefix().length() + extra = len(completion) - len(self.c.completionPrefix()) tc.movePosition(QTextCursor.Left) tc.movePosition(QTextCursor.EndOfWord) - tc.insertText(completion.right(extra)) + tc.insertText(completion[-extra:]) self.setTextCursor(tc)