hinting: leave hint mode if no hints

This commit is contained in:
Colin Caine 2017-11-23 01:10:45 +00:00
parent 616255c8ea
commit d1784c994d

View file

@ -51,10 +51,15 @@ export function hintPage(
modeState.hintchars += name modeState.hintchars += name
modeState.hints.push(new Hint(el, name, onSelect)) modeState.hints.push(new Hint(el, name, onSelect))
} }
console.log("HINTS", modeState.hints)
modeState.focusedHint = modeState.hints[0] if (modeState.hints.length) {
modeState.focusedHint.focused = true console.log("HINTS", modeState.hints)
document.body.appendChild(modeState.hintHost) modeState.focusedHint = modeState.hints[0]
modeState.focusedHint.focused = true
document.body.appendChild(modeState.hintHost)
} else {
reset()
}
} }
/** vimperator-style minimal hint names */ /** vimperator-style minimal hint names */