Closed hamxabaig closed 7 years ago
that's what line 19 tries to do.
what is the value of choices and choices.length in your case?
@siddharthkp You're right, sorry didn't see clearly. The choices has value ['']
. It has one empty element therefore its not being invoked.
Apart from this, We should show recent commands first. Like the last ones first.
But i think, your case will not work. What if user typed some query that didn't matched any of commands previously typed. Then i think your approach will throw all of the commands in resolve which is not correct.
@siddharthkp check now, I filtered the result (choices) with truthy values. Its working now.
Thanks! Published in 1.0.1
I checked and problem was that
hint
was empty when typinghistorie
. So filtering commands with emptyhint
was returning empty choices. I added a check whenhint
is empty then i just resolve it with recent 8 commands. Check this out below: