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)