Skip to content

Commit

Permalink
fix: Reset + and * to default register when clipboard is set (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshNavi authored Sep 5, 2022
1 parent f112602 commit 8154e65
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/which-key/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ function M.open(keys, opts)
M.count = vim.api.nvim_get_vvar("count")
M.reg = vim.api.nvim_get_vvar("register")

if string.find(vim.o.clipboard, "unnamedplus") and M.reg == "+" then
M.reg = '"'
end

if string.find(vim.o.clipboard, "unnamed") and M.reg == "*" then
M.reg = '"'
end

M.show_cursor()
M.on_keys(opts)
end
Expand Down

0 comments on commit 8154e65

Please sign in to comment.