Skip to content

Conversation

@nmiguel
Copy link

@nmiguel nmiguel commented Dec 8, 2025

Currently, debugprint uses the function snacks.picker.grep to find usages of "DEBUGPRINT" (or other custom print markers). In my opinion this is not the most appropriate picker offered by snacks.
The reason for this is that picker.grep simply writes DEBUGPRINT into a grep picker as if it were user input, while picker.grep_word preloads the grep picker with a given string in a separate way.

This is important since, in the current version, if a user opens the picker for debugprints and wants to match a given file, they first need to complete the rest of the input starting from the end of the debugprint marker. (see imgs 1 and 2).

image

This is the naive search, user opened the debug prints picker and wrote debug (to match the file). No results shown as the prompt starts from DEBUGPRINT.
image

This search correctly retrieves results, but requires the user start with a wildcard.

image

This final image is the different function that is present in the PR, not only is it displayed differently by Snacks itself, such that the debugprint marker can't be deleted, but even a naive search (like img 1) displays results as the debugprint marker and the user expression are evaluated separately. Do note that if the user has smart-case enabled (such as my case), it will now match lower-case strings, as apparently the smart-case is not triggered by the upper-case debugprint marker.

Let me finish by saying that I love this plugin and I use it daily, this is just a minor nitpick that I have and wanted to fix for myself, and decided to open a PR for it in case you find it useful. If there's anything I need to change to get this merged let me know, and if for some reason you don't find this PR useful feel free to close it. Thanks!

@andrewferrier
Copy link
Owner

Hi - thanks for the input. Will need to revisit this in a few days once I have the bandwidth to take a proper look but on the face of it this sounds like a positive improvement to me. Thanks for taking the time.

@andrewferrier andrewferrier merged commit 7af176c into andrewferrier:main Dec 14, 2025
@andrewferrier
Copy link
Owner

I've tested this locally and it works well, thank you - all merged!

@andrewferrier
Copy link
Owner

Thanks - I've merged this now. Works well - thanks for the improvement!

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.

2 participants