Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Causes Cursor Blink on Startup #130

Open
jam1015 opened this issue Sep 8, 2023 · 5 comments
Open

Causes Cursor Blink on Startup #130

jam1015 opened this issue Sep 8, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@jam1015
Copy link

jam1015 commented Sep 8, 2023

I previously left this issue talking about blink when focus is gained or lost.

I'm having trouble replicating that with the current version of the plugin (could close it?) it's back on macos, sorry for flipflopping, but now I'm having cursor blink in a specific situation:

When I load the plugin as lazily as possible with lazy.nvim with event set to VeryLazy, there is a cursor blink on startup.

I've isolated the cause: In the function utils.get_register_info, when I replace calls to vim.fn.getreg and vim.fn.getregtype with bogus string values, the cursor blink does not occur. For vim.fn.getregtype I used "v" as the bogus string. I can't think of a way to get around these calls.

@gbprod
Copy link
Owner

gbprod commented Sep 28, 2023

Hey!

Can you tell me what is your clipboard tool ? (you can see it using :checkhealth provider) ?
I think the problem could comes from your system clipboard provider...

@jam1015
Copy link
Author

jam1015 commented Oct 2, 2023

Hi! My clipboard at provider was at first xsel. Uninstalled xsel and then it was xclip. Uninstalled that and then it was lemonade which is supposed to work across ssh or something, but I got an error, and re-installed both xsel and xclip. The blink persisted with both xsel and xclip. It also persisted when I commented out vim.opt.clipboard = 'unnamedplus'

This issue happens with the config that I actually use which has a lot going on.

I hadn't made a simple reprex, so I did, and the issue does not persist, or happens so quickly that I can't see it.

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"--single-branch",
		"https://github.com/folke/lazy.nvim.git",
		lazypath,
	})
end
vim.opt.runtimepath:prepend(lazypath)

require("lazy").setup(
{
	"gbprod/yanky.nvim",
	dependencies = { "kkharji/sqlite.lua", },
	event = "VeryLazy",

	config = function()
		require("yanky").setup({
			
		})
	end

})


vim.keymap.set({"n","x"}, "p", "<Plug>(YankyPutAfter)")
vim.keymap.set({"n","x"}, "P", "<Plug>(YankyPutBefore)")
vim.keymap.set({"n","x"}, "gp", "<Plug>(YankyGPutAfter)")
vim.keymap.set({"n","x"}, "gP", "<Plug>(YankyGPutBefore)")
vim.keymap.set("n", "<c-n>", "<Plug>(YankyCycleForward)")
vim.keymap.set("n", "<c-p>", "<Plug>(YankyCycleBackward)")

--vim.opt.shortmess = "IFw" -- was seeing if theese settings changed anything; doesn't seem like it
vim.opt.clipboard = 'unnamedplus'

For now setting the event to 'UIEnter` in lazy prevents loading latency just as well as 'VeryLazy' (40 ms with my config, much less with the reprex for some reason)

@jam1015
Copy link
Author

jam1015 commented Oct 3, 2023

Solved the problem in my config for now. I previously had vim.opt.clipboard = 'unnamedplus' in a file called by my main init.lua. I moved this to the end of the file specified by config for yanky in my lazy.nvim package specification file and the blink went away.

@gbprod
Copy link
Owner

gbprod commented Oct 3, 2023

Interesting!
Thanks for your feedback.

@gbprod gbprod closed this as completed Oct 3, 2023
@jam1015
Copy link
Author

jam1015 commented Oct 3, 2023

I mentioned this issue saying that I couldn't reproduce it, but now I see it happening on MacOs. Will check on arch later, and further comment on that issue.

@gbprod gbprod reopened this Oct 4, 2023
@gbprod gbprod added the bug Something isn't working label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants