Add option for matching on previous command. #129

Closed
wants to merge 2 commits into
from

2 participants

@gezalore

New feature:
Setting ZSH_AUTOSUGGEST_MATCH_PREV_CMD will enable the plug-in to be a
bit more context aware when generating the suggestion, by matching the
previously executed command against the command executed before the
preferred suggestion. See src/config.zsh for an example.

Also added testing for the suggestion computation.

@gezalore gezalore Add option for matching on previous command.
Setting ZSH_AUTOSUGGEST_MATCH_PREV_CMD will enable the plug-in to be a
bit more context aware when generating the suggestion, by matching the
previously executed command against the command executed before the
preferred suggestion. See src/config.zsh for an example.

Also added testing for the suggestion computation.
046b905
@gezalore gezalore referenced this pull request Feb 28, 2016
Closed

Full Test Coverage #105

@ericfreese
zsh-users member

In anticipation of many differing ideas of what would be the best way to fetch a suggestion, I've implemented a strategy pattern for fetching suggestions.

See branch features/suggestion_strategies and in particular commit 8c1f67e that adds the src/strategies/ directory and the "default" strategy that just picks the most recent history match. A different strategy can be selected by setting the ZSH_AUTOSUGGEST_STRATEGY variable (but currently the only available strategy is "default").

Can you update your code to use this new strategy pattern, adding a new strategy file to the src/strategies/ directory? And then re-submit the PR to the features/suggestion_strategies branch instead of master?

Thanks!

@gezalore

Done, see #131. You can close this now if you feel that is appropriate. Thank you!

@ericfreese ericfreese closed this Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment