Globidev / term-picker

terminal item selector
MIT License
2 stars 0 forks source link

[feature] add fuzzy finding #2

Open rvion opened 9 years ago

rvion commented 9 years ago

you could use

window.getstr([y, x])

Read a string from the user, with primitive line editing capacity.

from here: http://stackoverflow.com/questions/21784625/how-to-input-a-word-in-ncurses-screen

Globidev commented 9 years ago

Yep, already made a working prototype with the levenshtein distance.

Still having issues with how to properly display it colorize matching letters? auto-expanding matching subitems? selecting best match? showing the current search string in a vim-like status bar?

rvion commented 9 years ago

experimental suggestion:

standard behaviour

if it is weird on screen, you could switch back to how sublime/atom/vim way are doing:

ex:

query: lem1

tree/folder1/elem1
tree/folder2/elem1
tree/folder3/elem1
tree/folder1/elem11
tree/folder1/elem21
tree/test/yolo