Skip to content

Commit

Permalink
fix(fzf-lua): add separator after prompt (#145)
Browse files Browse the repository at this point in the history
* feat(fzf-lua): add an input indicator after prompt

* refactor: only use '>' as separator if ':' is not being used

---------

Co-authored-by: Steven Arcangeli <[email protected]>
  • Loading branch information
ofseed and stevearc authored Mar 13, 2024
1 parent 6f21226 commit 18e5beb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lua/dressing/select/fzf_lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ M.is_supported = function()
end

M.select = function(config, items, opts, on_choice)
if opts.prompt then
-- If we're not using ":" as the separator, use ">"
if not vim.endswith(opts.prompt, ":") then
opts.prompt = opts.prompt .. ">"
end
-- Ensure there is some whitespace between the prompt and input
if not vim.endswith(opts.prompt, " ") then
opts.prompt = opts.prompt .. " "
end
end
local ui_select = require("fzf-lua.providers.ui_select")
if config and not vim.tbl_isempty(config) then
-- Registering then unregistering sets the config options
Expand Down

0 comments on commit 18e5beb

Please sign in to comment.