Don't crash on :completion-item-del with no item.
If :completion-item-del was invoked with no item selected (e.g. directly after pressing 'o'), there was a crash because the currentIndex was invalid. /cc @antoyo (but I believe one of my changes on top of yours caused this)
This commit is contained in:
parent
15e854237e
commit
5a25f0b98b
@ -488,6 +488,8 @@ class Completer(QObject):
|
|||||||
"""Delete the current completion item."""
|
"""Delete the current completion item."""
|
||||||
completion = objreg.get('completion', scope='window',
|
completion = objreg.get('completion', scope='window',
|
||||||
window=self._win_id)
|
window=self._win_id)
|
||||||
|
if not completion.currentIndex().isValid():
|
||||||
|
raise cmdexc.CommandError("No item selected!")
|
||||||
try:
|
try:
|
||||||
self.model().srcmodel.delete_cur_item(completion)
|
self.model().srcmodel.delete_cur_item(completion)
|
||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
|
Loading…
Reference in New Issue
Block a user