From 4f8751db5229ff2f315d584bdad36781ed5c196e Mon Sep 17 00:00:00 2001 From: bhagwan Date: Sun, 16 Jan 2022 10:07:50 -0800 Subject: [PATCH] LSP prompt renamed to 'prompt_postfix' (closes #308) --- README.md | 3 ++- doc/fzf-lua.txt | 3 ++- lua/fzf-lua/config.lua | 5 +---- lua/fzf-lua/providers/lsp.lua | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f8dedf7..d73a21a 100644 --- a/README.md +++ b/README.md @@ -581,7 +581,8 @@ require'fzf-lua'.setup { git_icons = true, }, lsp = { - prompt = '❯ ', + prompt_postfix = '❯ ', -- will be appended to the LSP label + -- to override use 'prompt' instead cwd_only = false, -- LSP/diagnostics for cwd only? async_or_timeout = 5000, -- timeout(ms) or 'true' for async calls file_icons = true, diff --git a/doc/fzf-lua.txt b/doc/fzf-lua.txt index 1dc86d7..5565850 100644 --- a/doc/fzf-lua.txt +++ b/doc/fzf-lua.txt @@ -619,7 +619,8 @@ Consult the list below for available settings: git_icons = true, }, lsp = { - prompt = '❯ ', + prompt_postfix = '❯ ', -- will be appended to the LSP label + -- to override use 'prompt' instead cwd_only = false, -- LSP/diagnostics for cwd only? async_or_timeout = 5000, -- timeout(ms) or 'true' for async calls file_icons = true, diff --git a/lua/fzf-lua/config.lua b/lua/fzf-lua/config.lua index ff504f5..08e352f 100644 --- a/lua/fzf-lua/config.lua +++ b/lua/fzf-lua/config.lua @@ -424,7 +424,7 @@ M.globals.manpages = { } M.globals.lsp = { previewer = M._default_previewer_fn, - prompt = '> ', + prompt_postfix = '> ', file_icons = true and M._has_devicons, color_icons = true, git_icons = false, @@ -653,9 +653,6 @@ function M.normalize_opts(opts, defaults) -- ,("'%s' is now defined under '%s'"):format(v, k)) end - -- Default prompt - opts.prompt = opts.prompt or opts.fzf_opts["--prompt"] - if type(opts.previewer) == 'function' then -- we use a function so the user can override -- globals.winopts.preview.default diff --git a/lua/fzf-lua/providers/lsp.lua b/lua/fzf-lua/providers/lsp.lua index 5c3f934..1dde3d0 100644 --- a/lua/fzf-lua/providers/lsp.lua +++ b/lua/fzf-lua/providers/lsp.lua @@ -275,8 +275,8 @@ local normalize_lsp_opts = function(opts, cfg) if not opts then return end if not opts.cwd then opts.cwd = vim.loop.cwd() end - if not opts.prompt or opts.prompt == config.globals.lsp.prompt then - opts.prompt = opts.lsp_handler.label .. cfg.prompt + if not opts.prompt and opts.prompt_postfix then + opts.prompt = opts.lsp_handler.label .. (opts.prompt_postfix or '') end opts.bufnr = nil