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

Add: search prefix only #115

Merged
merged 4 commits into from
Aug 2, 2021
Merged

Add: search prefix only #115

merged 4 commits into from
Aug 2, 2021

Conversation

SleepyBag
Copy link
Contributor

Close #112

@basilgood
Copy link

I just checked this and it works perfectly.
Why it's not merged yet ?
Good job @SleepyBag

Copy link
Member

@sunaku sunaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. Please see my comments in the code review. I think we can simplify this feature's implementation further.

zsh-history-substring-search.zsh Outdated Show resolved Hide resolved
@@ -48,6 +48,7 @@ typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold'
typeset -g HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i'
typeset -g HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=''
typeset -g HISTORY_SUBSTRING_SEARCH_FUZZY=''
typeset -g HISTORY_SUBSTRING_SEARCH_PREFIX=''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use true/false values for boolean feature flags rather than non/empty strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that all the other flags are using the non/empty pattern. I don't think it's good to introduce inconsistency.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks for checking this.

zsh-history-substring-search.zsh Outdated Show resolved Hide resolved
zsh-history-substring-search.zsh Outdated Show resolved Hide resolved
Copy link
Member

@sunaku sunaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good now, thanks! Could you please also add some documentation for this new variable in the Configuration section of the README? After this, we can merge the PR. Thanks.

@SleepyBag
Copy link
Contributor Author

Documentation added.

@sunaku sunaku merged commit 4f2f17c into zsh-users:master Aug 2, 2021
@sunaku
Copy link
Member

sunaku commented Aug 3, 2021

NOTE: I have since renamed the configuration variable, in commit 4abed97:

Also rename HISTORY_SUBSTRING_SEARCH_PREFIX variable by adding "ED"
suffix so that it reads more like a special mode of operation rather
than an instruction to prepend a specified prefix to matched commands.

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

Successfully merging this pull request may close these issues.

Feature Request: Match with prefix only
5 participants