Skip to content

Commit

Permalink
fix: defer clipboard because xsel and pbcopy can be slow
Browse files Browse the repository at this point in the history
Co-authored-by: abeldekat <abel@nomail.com>
  • Loading branch information
mehalter and abeldekat committed Jul 22, 2024
1 parent a269211 commit 3bc1868
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/astrocore/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,15 @@ function M.setup(opts)

-- options
if vim.bo.filetype == "lazy" then vim.cmd.bw() end
if vim.tbl_get(M.config, "options", "opt", "clipboard") then
local opt = M.config.options.opt
local lazy_clipboard = opt.clipboard
opt.clipboard = nil
vim.schedule(function() -- defer setting clipboard
opt.clipboard = lazy_clipboard
vim.opt.clipboard = opt.clipboard
end)
end
for scope, settings in pairs(M.config.options) do
for setting, value in pairs(settings) do
vim[scope][setting] = value
Expand Down

0 comments on commit 3bc1868

Please sign in to comment.