Skip to content

Commit

Permalink
fix: handle extra scenario where the prompt is sent with trailing spa…
Browse files Browse the repository at this point in the history
…ces (#138)

* fix: handle extra scenario where the prompt is sent with trailing spaces

* changed selection for gsub

* trimmed correctly using vim.trim method
  • Loading branch information
231tr0n committed Jan 21, 2024
1 parent c117933 commit 7237cdf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/dressing/select/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ local select = vim.schedule_wrap(function(items, opts, on_choice)
end

opts.prompt = sanitize_line(opts.prompt or "Select one of:")
opts.prompt = vim.trim(opts.prompt)
if config.trim_prompt and opts.prompt:sub(-1, -1) == ":" then
opts.prompt = opts.prompt:sub(1, -2)
end
Expand Down

0 comments on commit 7237cdf

Please sign in to comment.