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

Fix don't quote prompt when quote_char is empty string #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rafamadriz
Copy link

I already have a keymap to quote the prompt, so my current workflow is: type query-> Quote prompt -> Start adding options

However I would like to create keymaps for some common options I use, currently this not possible because when quote_char is emtpy, it still adds backslashes before each character in prompt, and this breaks the search pattern

Usecase is for chaining mulitple rg options without, quoting the prompt mulitple times, which is not the expected behavior when quote_char is empty string.

E.g Consider this keymap

["<C-;>"] = require("telescope-live-grep-args.actions").quote_prompt {
        postfix = " --word-regexp ",
        quote_char = "",
    }

And I search for tab, then pressing <C-;>:

Before:

\"\t\a\b\"\ --word-regexp

After:

"tab" --word-regexp

I already have a keymap to quote the prompt, so my current workflow is:
type query-> Quote prompt -> Start adding options

However I would like to create keymaps for some common options I use,
currently this not possible because when `quote_char` is emtpy, it still adds
backslashes before each character in prompt, and this breaks the search pattern

Usecase is for chaining mulitple `rg` options without, quoting
the prompt mulitple times, which is not the expected behavior when
`quote_char` is empty string.

E.g Consider this keymap

```lua
["<C-;>"] = require("telescope-live-grep-args.actions").quote_prompt {
        postfix = " --word-regexp ",
        quote_char = "",
    }
```

And I search for `tab`, then pressing `<C-;>`:

Before:

```
\"\t\a\b\"\ --word-regexp
```

After:

```
"tab" --word-regexp
```
rafamadriz added a commit to rafamadriz/dotfiles that referenced this pull request May 29, 2023
rafamadriz added a commit to rafamadriz/dotfiles that referenced this pull request May 29, 2023
rafamadriz added a commit to rafamadriz/dotfiles that referenced this pull request Jun 3, 2023
@thomas-hiron
Copy link

Hello, I would definitively need that feature too! Any chance of merging this?
@rafamadriz do you have a workaround for now?
Thanks!

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.

None yet

2 participants