Skip to content

Commit

Permalink
feat: live_ast_prefix to control "live" asterisk prefix
Browse files Browse the repository at this point in the history
closes #1050
  • Loading branch information
ibhagwan committed Feb 21, 2024
1 parent 67486bc commit 296ff49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lua/fzf-lua/providers/grep.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ local function normalize_live_grep_opts(opts)

-- prepend prompt with "*" to indicate "live" query
opts.prompt = type(opts.prompt) == "string" and opts.prompt or ""
opts.prompt = opts.prompt:match("^%*") and opts.prompt or ("*" .. opts.prompt)
if opts.live_ast_prefix ~= false then
opts.prompt = opts.prompt:match("^%*") and opts.prompt or ("*" .. opts.prompt)
end

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

-- prepend prompt with "*" to indicate "live" query
opts.prompt = type(opts.prompt) == "string" and opts.prompt or ""
opts.prompt = opts.prompt:match("^%*") and opts.prompt or ("*" .. opts.prompt)
if opts.live_ast_prefix ~= false then
opts.prompt = opts.prompt:match("^%*") and opts.prompt or ("*" .. opts.prompt)
end

-- 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 296ff49

Please sign in to comment.