Hide on escape

This commit is contained in:
Anton Medvedev 2018-12-02 23:16:25 +07:00
parent b12ae5a243
commit 40f88dcc91

5
fx.js
View File

@ -285,8 +285,9 @@ module.exports = function start(filename, source) {
if (typeof json === 'object' && json.constructor === Object) {
const keys = Object.keys(json).filter(key => key.startsWith(match[1]))
// Don't show if there is complete match.
if (keys.length === 1 && keys[0] === match[1]) {
// Hide if there is nothing to show or
// don't show if there is complete match.
if (keys.length === 0 || (keys.length === 1 && keys[0] === match[1])) {
autocomplete.hide()
return
}