Skip to content

Commit

Permalink
fix(util): when no clipboard provider exists, use the " register as d…
Browse files Browse the repository at this point in the history
…efault. Fixes #687
  • Loading branch information
folke committed Jul 14, 2024
1 parent bfb1e58 commit d077a3f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/which-key/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ end

-- Default register
function M.reg()
-- this will be set to 2 if there is a non-empty clipboard
-- tool available
if vim.g.loaded_clipboard_provider ~= 2 then
return '"'
end
local cb = vim.o.clipboard
return cb:find("unnamedplus") and "+" or cb:find("unnamed") and "*" or '"'
end
Expand Down

0 comments on commit d077a3f

Please sign in to comment.