Skip to content

Commit

Permalink
fix: git commit hash yank to consider clipboard (#966)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Dec 24, 2023
1 parent de33c83 commit 3d71803
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lua/fzf-lua/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,14 @@ end

M.git_yank_commit = function(selected, opts)
local commit_hash = match_commit_hash(selected[1], opts)
vim.fn.setreg([[0]], commit_hash)
vim.fn.setreg([["]], commit_hash)
if vim.o.clipboard == "unnamed" then
vim.fn.setreg([[*]], commit_hash)
elseif vim.o.clipboard == "unnamedplus" then
vim.fn.setreg([[+]], commit_hash)
else
vim.fn.setreg([[0]], commit_hash)
vim.fn.setreg([["]], commit_hash)
end
end

M.git_checkout = function(selected, opts)
Expand Down

0 comments on commit 3d71803

Please sign in to comment.