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

How to show the history lines when using TAB #90

Closed
zuiaiqun opened this issue Aug 4, 2017 · 2 comments
Closed

How to show the history lines when using TAB #90

zuiaiqun opened this issue Aug 4, 2017 · 2 comments

Comments

@zuiaiqun
Copy link

zuiaiqun commented Aug 4, 2017

Hello, I'm wondering why not expose the history data to the caller?
The case is when I'm using the tab key, I need to find item from all I have input.
Howerver, the functions which are used to get the history data from the State are all invisible to us. Why not write a function like GetHistoryByPrefix rather than getHistroyByPrefix for the caller to use?

@peterh
Copy link
Owner

peterh commented Aug 4, 2017

If you want "search history starting with the prompt so far", the hotkey to use is Up instead of Tab.

If you want to keep history to inform your tab completion function, you can keep track of it yourself. (ie. call your own internal AppendHistory function in addition to liner's).

getHistoryByPrefix is not exported because liner already exports way too much API that has to remain compatible across revisions. I wish liner exported fewer functions, not more.

@zuiaiqun
Copy link
Author

zuiaiqun commented Aug 5, 2017

ok, thanks.

@zuiaiqun zuiaiqun closed this as completed Aug 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants