Hide completion if there are no items

This commit is contained in:
Florian Bruhin 2014-06-03 10:46:58 +02:00
parent e294c01d7d
commit a555aa66a0

View File

@ -330,6 +330,11 @@ class CompletionView(QTreeView):
pattern = parts[cursor_part] if parts else ''
logger.debug("pattern: {}".format(pattern))
self._model.pattern = pattern
if self._model.item_count() == 0:
self.hide()
return
self._model.mark_all_items(pattern)
if self._enabled:
self.show()