Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't drop buffered input data in findOffset() #1392

Merged
merged 1 commit into from
Sep 26, 2018

Conversation

timbertson
Copy link
Contributor

@timbertson timbertson commented Sep 26, 2018

Sometimes when fzf takes a while to startup, I start typing but my input gets dropped once the UI actually renders, and it's slightly annoying. It's rare (because fzf is usually quick), but noticeable particularly on first run after booting.

To reproduce, you can simulate a slow load with:

git ls-files | (sleep 1; fzf)

Currently anything you type in the first second will be dropped, with this change it gets consumed as search input once fzf loads.

I don't know if it's a bit weird to modify r.buffer during findOffsets(). It could alternatively return (skipped, row, col) and leave it up to the caller to add skipped to r.buffer, but that might get awkward.

I also don't know if this is the only place which needs this fix - is there a dark TUI as well as a light one?

@junegunn
Copy link
Owner

Although I can't reproduce the issue with the command above, I do experience drops when using CTRL-R binding for bash and your patch fixes it.

findOffset is not a pure function already, so I can live with it appending leftover keystrokes to the internal buffer. I'll just merge the patch, thanks!

is there a dark TUI as well as a light one?

Ah, no. LightRenderer was named "light" just because it did not depend on ncurses unlike the old FullscreenRenderer :)

@junegunn junegunn merged commit 70a92a8 into junegunn:master Sep 26, 2018
@junegunn junegunn added this to the 0.17.5 milestone Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants