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 options to constrain and broaden files searched #137

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

maw
Copy link
Contributor

@maw maw commented Aug 11, 2023

I added some code to cycle between search scopes:

  • Searching the currently specified directory. This is how deadgrep has always worked.
  • Limit the search to files that correspond to open buffers in the currently specified directory.
  • Expand the search to all files that correspond to open buffers, both in and out of the currently specified directory.

I think this is cool. But here are some problems (that I am willing to address)

  • Some of the new code is probably in the wrong place in deadgrep.el
  • What this new stuff means probably isn't obvious enough in the UI or the documentation
  • My set theory is rusty so I forget what this should be called, but there's a fourth scope that I didn't implement: all files in currently selected directory plus all (other) open files.
  • If you're in the "open buffers" scope, then the selected directory is ignored. The UI should probably reflect this somehow, maybe by greying out Directory:.
  • Scope: in the deadgrep UI this should probably be moved near Directory:, probably just above it.

deadgrep--filenames-of-open-files returns the names of the files that back
open buffers.

deadgrep--filenames-of-open-files-in-project returns the names of open files
in the current project.
@maw maw changed the title Add options to constrain and broaden files searched 3 Add options to constrain and broaden files searched Aug 11, 2023
@maw
Copy link
Contributor Author

maw commented Aug 11, 2023

Another annoyance: if you're using the in directory open buffers scope it shows full paths.

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.

1 participant