Skip to content

Commit

Permalink
fix: live query prompt starting with asterisk (closes #940)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Nov 30, 2023
1 parent 1fa0252 commit 474af4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lua/fzf-lua/providers/grep.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ local function normalize_live_grep_opts(opts)
-- opts.__module__ = opts.__module__ or "grep"

-- prepend prompt with "*" to indicate "live" query
opts.prompt = opts.prompt and opts.prompt:match("^%*") or "*" .. opts.prompt
opts.prompt = type(opts.prompt) == "string" and opts.prompt or ""
opts.prompt = opts.prompt:match("^%*") and opts.prompt or ("*" .. opts.prompt)

-- when using live_grep there is no "query", the prompt input
-- is a regex expression and should be saved as last "search"
Expand Down
3 changes: 2 additions & 1 deletion lua/fzf-lua/providers/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,8 @@ M.live_workspace_symbols = function(opts)
opts.__ACT_TO = opts.__ACT_TO or M.workspace_symbols

-- prepend prompt with "*" to indicate "live" query
opts.prompt = opts.prompt and opts.prompt:match("^%*") or "*" .. opts.prompt
opts.prompt = type(opts.prompt) == "string" and opts.prompt or ""
opts.prompt = opts.prompt:match("^%*") and opts.prompt or ("*" .. opts.prompt)

-- when using live_workspace_symbols there is no "query"
-- the prompt input is the LSP query, store as "lsp_query"
Expand Down

0 comments on commit 474af4d

Please sign in to comment.