Add option for matching on previous command. #129
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!
Done, see #131. You can close this now if you feel that is appropriate. Thank you!
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.