rename strng to more sensible names
This commit is contained in:
parent
e28c1bf9b8
commit
8873aba09f
@ -676,10 +676,10 @@ class HintManager(QObject):
|
|||||||
elems = [e for e in elems if filterfunc(e)]
|
elems = [e for e in elems if filterfunc(e)]
|
||||||
if not elems:
|
if not elems:
|
||||||
raise cmdexc.CommandError("No elements found.")
|
raise cmdexc.CommandError("No elements found.")
|
||||||
strings = self._hint_strings(elems)
|
hints = self._hint_strings(elems)
|
||||||
for e, strng in zip(elems, strings):
|
for e, hint in zip(elems, hints):
|
||||||
label = self._draw_label(e, strng)
|
label = self._draw_label(e, hint)
|
||||||
self._context.elems[strng] = ElemTuple(e, label)
|
self._context.elems[hint] = ElemTuple(e, label)
|
||||||
keyparsers = objreg.get('keyparsers', scope='window',
|
keyparsers = objreg.get('keyparsers', scope='window',
|
||||||
window=self._win_id)
|
window=self._win_id)
|
||||||
keyparser = keyparsers[usertypes.KeyMode.hint]
|
keyparser = keyparsers[usertypes.KeyMode.hint]
|
||||||
@ -826,11 +826,11 @@ class HintManager(QObject):
|
|||||||
def handle_partial_key(self, keystr):
|
def handle_partial_key(self, keystr):
|
||||||
"""Handle a new partial keypress."""
|
"""Handle a new partial keypress."""
|
||||||
log.hints.debug("Handling new keystring: '{}'".format(keystr))
|
log.hints.debug("Handling new keystring: '{}'".format(keystr))
|
||||||
for (strng, elems) in self._context.elems.items():
|
for (text, elems) in self._context.elems.items():
|
||||||
try:
|
try:
|
||||||
if strng.startswith(keystr):
|
if text.startswith(keystr):
|
||||||
matched = strng[:len(keystr)]
|
matched = text[:len(keystr)]
|
||||||
rest = strng[len(keystr):]
|
rest = text[len(keystr):]
|
||||||
match_color = config.get('colors', 'hints.fg.match')
|
match_color = config.get('colors', 'hints.fg.match')
|
||||||
elems.label.setInnerXml(
|
elems.label.setInnerXml(
|
||||||
'<font color="{}">{}</font>{}'.format(
|
'<font color="{}">{}</font>{}'.format(
|
||||||
@ -931,8 +931,8 @@ class HintManager(QObject):
|
|||||||
# Show all hints again
|
# Show all hints again
|
||||||
self.filter_hints(None)
|
self.filter_hints(None)
|
||||||
# Undo keystring highlighting
|
# Undo keystring highlighting
|
||||||
for (strng, elems) in self._context.elems.items():
|
for (text, elems) in self._context.elems.items():
|
||||||
elems.label.setInnerXml(strng)
|
elems.label.setInnerXml(text)
|
||||||
handler()
|
handler()
|
||||||
|
|
||||||
@cmdutils.register(instance='hintmanager', scope='tab', hide=True,
|
@cmdutils.register(instance='hintmanager', scope='tab', hide=True,
|
||||||
|
Loading…
Reference in New Issue
Block a user