Skip to content

Commit 98fb51f

Browse files
rohit-s8ibhagwan
authored andcommitted
fix: prioritize opts.prompt if available
The fix for issue #786 breaks setups where user wants a consistent prompt text for all vim.ui.select operations. Previously, this used to be provided in `opts` like below (for eg.): ```lua require("fzf-lua").register_ui_select(function(ui_opts, _) return { prompt = "❯ ", winopts = { title = ui_opts.prompt:gsub(":%s*$", ""), title_pos = "center", height = 0.33, width = 0.5 } } ``` With the updated changes, the prompt provided above is not considered and one must change the provided `ui_opts.prompt` instead. The changes proposed here prioritize `opts.prompt` if available.
1 parent 566e805 commit 98fb51f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/fzf-lua/providers/ui_select.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ M.ui_select = function(items, ui_opts, on_choice)
9898

9999
-- Force override prompt or it stays cached (#786)
100100
local prompt = ui_opts.prompt or "Select one of:"
101-
opts.prompt = prompt:gsub(":%s?$", "> ")
101+
opts.prompt = opts.prompt or prompt:gsub(":%s?$", "> ")
102102

103103
-- save items so we can access them from the action
104104
opts._items = items

0 commit comments

Comments
 (0)