-
Notifications
You must be signed in to change notification settings - Fork 46
WIP: Transient interface for Deadgrep #164
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
Draft
iquiw
wants to merge
11
commits into
Wilfred:master
Choose a base branch
from
iquiw:transient
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Introduce new command `deadgrep-transient`, which invokes transient menu for deadgrep. * In deadgrep-mode, bind "t" key to `deadgrep-transient`.
* Remove suffixes, "Search in project root", "Search in current directory". * Add suffixes, "Restart search with new term", "New search".
Implemented the above change. |
It sets deadgrep options according to transient arguments and writes heading.
When `deadgrep-transient-menu` is called, the values are initialized as follows. 1. If it is called from deadgrep results buffer, initialized with options in the previous search. 2. If there is saved value of `deadgrep-transient-prefix`, initialized with the saved value. 3. Otherwise, initialized with default value.
|
Just as an additional data point: I'd be looking forward to this being integrated too. Already started writing my own transient when I stumbled across this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Hi, this PR provides transient interface for deadgrep.
This makes it easy to add new options to deadgrep through the transient API.
I'd like to hear your opinion whether it can be included in deadgrep.
Ref. #125
For example, we can add
--search-zipoptions like the following. Ref. #110Changes
deadgrep-transient-menu, which invokes transient menu for deadgrep.deadgrep-transient-menuindeadgrep-mode-map.deadgrep--arguments-functionanddeadgrep--write-heading-function,which are default to
deadgrep--argumentsanddeadgrep--write-headingrespectively and overridden in deadgrep-transient.TODO
This PR is a draft due to the following reasons.
No document. README.md is not updated yet.This currently provides 2 transient suffixes, "Search in project root" and "Search in current directory",but I am considering if it is better to add transient infix to set the search directory instead.So deadgrep-transient options cannot be translated to deadgrep options in some cases.
For example, it is possible that "--word-regexp" is on and "--fixed-strings" is off in deadgrep-transient, while there is no corresponding option in deadgrep.
We might add some optional text in deadgrep heading for them.
Correspondence between some of deadgrep options and ripgrep options.