Skip to content

Escape dash in prompt to prevent using beginning of the prompt as an option#76

Open
mambusskruj wants to merge 1 commit into
nvim-telescope:masterfrom
mambusskruj:54
Open

Escape dash in prompt to prevent using beginning of the prompt as an option#76
mambusskruj wants to merge 1 commit into
nvim-telescope:masterfrom
mambusskruj:54

Conversation

@mambusskruj

@mambusskruj mambusskruj commented Feb 7, 2024

Copy link
Copy Markdown

Description

Rough, but it works 🤔
Looking forward to the author's review and comments.

Check for a dash at the beginning of the prompt and escape it.
We need to escape dash at the beginning of the prompt because such dash will be interpreted as an option in rg.

Fixes #54

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Search for phrases like: "--jobs 123", " --jobs 123", "here's -jobs 123", "'--jobs 123' --iglob *", "'here's --jobs 123' --iglob *", etc.

Configuration:
NVIM v0.10.0-dev-6074+gfbe40caa7-Homebrew
Build type: Release
LuaJIT 2.1.1703358377

MacOS 14.2.1

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • (no need) I have made corresponding changes to the documentation (lua annotations)

@mambusskruj mambusskruj changed the title WIP: Escape dash in prompt to prevent using part of prompt as an option WIP: Escape dash in prompt to prevent using beginning of the prompt as an option Feb 7, 2024
@mambusskruj mambusskruj changed the title WIP: Escape dash in prompt to prevent using beginning of the prompt as an option Escape dash in prompt to prevent using beginning of the prompt as an option Feb 8, 2024
@mambusskruj mambusskruj marked this pull request as ready for review February 12, 2024 11:07
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.

Allow to parse search phrase in quotes "as is"

1 participant