Handle prefixes correctly in on_change_completed_part
This commit is contained in:
parent
771aff8b95
commit
3c343ecff7
@ -377,7 +377,7 @@ class _Command(QLineEdit):
|
|||||||
self.show_cmd.emit()
|
self.show_cmd.emit()
|
||||||
|
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
def on_change_completed_part(self, text):
|
def on_change_completed_part(self, newtext):
|
||||||
"""Change the part we're currently completing in the commandline.
|
"""Change the part we're currently completing in the commandline.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -385,9 +385,15 @@ class _Command(QLineEdit):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
# FIXME we should consider the cursor position.
|
# FIXME we should consider the cursor position.
|
||||||
parts = split_cmdline(self.text())
|
text = self.text()
|
||||||
parts[-1] = text
|
if text[0] in ':/?':
|
||||||
self.setText(':' + ' '.join(parts))
|
prefix = text[0]
|
||||||
|
text = text[1:]
|
||||||
|
else:
|
||||||
|
prefix = ''
|
||||||
|
parts = split_cmdline(text)
|
||||||
|
parts[-1] = newtext
|
||||||
|
self.setText(prefix + ' '.join(parts))
|
||||||
self.setFocus()
|
self.setFocus()
|
||||||
self.show_cmd.emit()
|
self.show_cmd.emit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user