feat(pickers/grep): add ltrim_text option #3369
Closed
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.
Description
When I grep multiple files, pickers are usually filled with leading white space. I find it easier if all entries are vertically aligned, even if that doesn't reflect the actual line in file.
I was doing this in my config:
Figured it would be better if I sneak a config option in the picker, so here's my attempt to do so.
I'm not familiar with Lua, Telescope nor NVim. (I'm a cool person though)
I'm very open to change code or add docs if someone can point me in the right direction.
I've tried using
text.triml()
but that didn't work for me, so I went with the regex. Is there a more performant way to do that in Lua/NVim?Type of change
How Has This Been Tested?
I see grepped lines without the leading space when I set the option. Not setting it has the same effect of setting it to false, so it defaults to the current behavior (not a breaking change).
Default behavior:
With
ltrim_text = true
:Configuration:
Checklist: