Fix cursor position after completing.

This commit is contained in:
Florian Bruhin 2014-06-02 16:10:59 +02:00
parent 1bb757a39e
commit f9eb2af979

View File

@ -155,7 +155,10 @@ class Command(MinimalLineEdit):
logger.debug("parts: {}, changing {} to '{}'".format(
parts, self.cursor_part, newtext))
parts[self.cursor_part] = newtext
cursor_str = self.prefix + ' '.join(parts[:self.cursor_part + 1])
self.setText(self.prefix + ' '.join(parts))
logger.debug("Placing cursor after '{}'".format(cursor_str))
self.setCursorPosition(len(cursor_str))
self.setFocus()
self.show_cmd.emit()