'Show hints for the given prefix (or hide if prefix is empty).
Args:
prefix: The current partial keystring.'

@pyqtSlot(str)
def update_keyhint(self, modename, prefix):

    if (not prefix):
        self._show_timer.stop()
        self.hide()
        return
    blacklist = (config.get('ui', 'keyhint-blacklist') or [])
    keyconf = objreg.get('key-config')
    def blacklisted(keychain):
        return any((fnmatch.fnmatchcase(keychain, glob) for glob in blacklist))
    bindings = [(k, v) for (k, v) in keyconf.get_bindings_for(modename).items() if (k.startswith(prefix) and (not utils.is_special_key(k)) and (not blacklisted(k)))]
    if (not bindings):
        self._show_timer.stop()
        return
    self._show_timer.setInterval(config.get('ui', 'keyhint-delay'))
    self._show_timer.start()
    suffix_color = html.escape(config.get('colors', 'keyhint.fg.suffix'))
    text = ''
    for (key, cmd) in bindings:
        text += "<tr><td>{}</td><td    style='color:    {}'>{}</td><td    style='padding-left:    2ex'>{}</td></tr>".format(html.escape(prefix), suffix_color, html.escape(key[len(prefix):]), html.escape(cmd))
    text = '<table>{}</table>'.format(text)
    self.setText(text)
    self.adjustSize()
    self.update_geometry.emit()
