todo-comments.nvim icon indicating copy to clipboard operation
todo-comments.nvim copied to clipboard

This Plugin Breaks the Neovim Start Screen

Open amarakon opened this issue 2 years ago • 6 comments

When opening Neovim without arguments and without this plugin, I can see the start screen. With this plugin, I see it only for a millisecond and then it disappears. I can conclude that this plugin is causing the Neovim start screen to not show. I do not know why though.

amarakon avatar Sep 24 '22 02:09 amarakon

Same here

tony-sol avatar Oct 14 '22 13:10 tony-sol

Same here

sadtab avatar Nov 14 '22 16:11 sadtab

Same. Please fix it.

vaxowt avatar Feb 20 '23 12:02 vaxowt

Feel free to submit a PR. I don't use the Neovim start screen, so won't spend the time to look into this. Todo-comments doesn't do anything weird, no idea what's causing this

folke avatar Feb 20 '23 12:02 folke

I looked into this and concluded that it's caused by config.colors() function being called from a deferred function (setup()), more precisely these 3 lines:

vim.cmd("hi def TodoBg" .. kw .. " guibg=" .. hex .. " guifg=" .. fg .. " gui=" .. bg_gui)
vim.cmd("hi def TodoFg" .. kw .. " guibg=NONE guifg=" .. hex .. " gui=" .. fg_gui)
vim.cmd("hi def TodoSign" .. kw .. " guibg=" .. sign_bg .. " guifg=" .. hex .. " gui=NONE")

:highlight command triggers redrawing, which causes the start screen to disappear. I managed to fix this behaviour by adding event='VimEnter' to my packer setup. It looks like this:

use {
	'folke/todo-comments.nvim',
	requires = 'nvim-lua/plenary.nvim',
	event = 'VimEnter',
	config = function()
		require('todo-comments').setup()
	end
}

Remember to run :PackerCompile if you change your configuration.

MPWrobel avatar May 03 '23 20:05 MPWrobel

@MPWrobel's solution works for me

tony-sol avatar May 03 '23 20:05 tony-sol

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 06 '24 01:07 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jul 13 '24 01:07 github-actions[bot]