Escaped characters contains several characters, they should all be ready
before parsing. now the reader thread will sleep for a while waiting the
characters to be ready.
P.S. If we can use NON-block read in rust, we can avoid this.
This synchronization is needed. Otherwise model will recieve additional
matched items or be cleared unexpectly.
Also change the refresh strategy to avoid screen flickr.
Previously the match process is executed in chunks(100 items) and then check
if there is a new event come. It will cause some delay when user change the
query. Now we check the eventbox after each item is processed.
Previously whether an item is selected or not is saved in the item. Normally
the selected item won't be much. When finally we want to output, the original
strategy would have to iterate through all existing items and check whether
they are selected or not.
Now we extract this info out, so that we only need to iterate over the
selected ones instead of the whole set. Improve the speed.
the problem is that the controller will save all items read before send the
NewItem event to matcher. Meanwhile the matcher keeps going because no signal
is received. And since the controller will need to lock the data of items and
that lock is not released by matcher. Kind of deadlock here.
Input used `wget_wch` to fetch keys pressed which occupys stdin of terminal,
thus causes reader failure in reading from stdin. So fzf-rs won't be able to
handle input from stdin.
Now the input is read from `/dev/tty` file. Requires nightly to build.