-
Notifications
You must be signed in to change notification settings - Fork 40
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
Smarter auto-quoting #6
Comments
Thanks for the detailed explanation. Currently it is really "raw" because it parses the prompt like shell args. What about this?:
Covers everything inlcuding the wonderful life ;) One common search I am running is |
That sounds great to me!
Just my two cents, but I do think smart-quoting should be enabled by default personally; No other telescope prompt expects you to quote simple multiple word queries like this... Anyway, appreciate you taking over this feature! |
The auto-quoting can be tested in #13. Also happy for any PR feedback. |
Firstly, thanks @weeman1337 for taking the time with this extension! Life got busy, and my PR fell by the wayside 😂
Anyway, one of the features I had started to implement in my PR was auto-quoting. For example in your extension, I can't search a string like
function create
unless I wrap it in quotes'function create'
first.I personally think spaces should be treated as part of the search query, unless command line options are needed, or quotes are part of the query you are trying to search...
function create
rg 'function create'
func.*create
rg 'func.*create'
it's a wonderful life
rg "it's a wonderful life"
'function create'
rg 'function create'
"function create"
rg "function create"
-uu 'func.*create'
rg -uu 'func.*create'
'func.*create' vendor
rg 'func.*create' vendor
Note: The
it's a wonderful life
example might be the most subjective and/or complicated one. The way I had implemented it in https://github.com/jesseleite/vim-agriculture was, if a single quote is used in the query at all, then don't auto-quote anything, and expect the user to wrap the query in quotes. It would be neat if it could detect single quotes vs quote pairs, but I understand if we skip on that one.Curious on your thoughts? ❤️
The text was updated successfully, but these errors were encountered: