dashboard-nvim icon indicating copy to clipboard operation
dashboard-nvim copied to clipboard

When defining more than 6 shortcuts (like 7 shortcuts), it gets frozen

Open ryoppippi opened this issue 2 years ago • 3 comments

Describe the bug When defining less than 7 (like 6 shortcuts), it works, Howerver, when I define 7 shortcuts, the loading screen frozen. To Reproduce my config is here

return {
	"glepnir/dashboard-nvim",
	dependencies = { { "nvim-tree/nvim-web-devicons" } },
	event = "VimEnter",
	opts = function()
		return {
			theme = "hyper",
			config = {
				week_header = {
					enable = true,
				},
				shortcut = {
					{
						desc = "Restore Session",
						icon = " ",
						icon_hl = "@function",
						action = 'lua require("persistence").load()',
						key = "s",
					},
					{
						desc = "Files",
						icon = " ",
						icon_hl = "@variable",
						group = "Label",
						action = "Telescope find_files",
						key = "f",
					},
					{
						desc = "Oil",
						icon = "󰈙 ",
						icon_hl = "@variable",
						group = "Label",
						action = ":Oil",
						key = ".",
					},
					{
						desc = "MRU",
						icon = " ",
						group = "DiagnosticHint",
						action = "Telescope oldfiles",
						key = "r",
					},
					{
						desc = "dotfiles",
						icon = " ",
						action = "Config",
						key = "d",
					},
					{
						desc = "Lazy",
						icon = "󰒲 ",
						icon_hl = "@property",
						group = "Label",
						action = "Lazy",
						key = "z",
					},
					{
						desc = "Quit",
						icon = " ",
						icon_hl = "@property",
						action = "qa",
						key = "q",
					},
				},
			},
		}
	end,
}

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

https://github.com/nvimdev/dashboard-nvim/assets/1560508/9533c59a-dd92-47c1-a2b6-7f2f00822dbc

ryoppippi avatar Aug 14 '23 09:08 ryoppippi

I will check it later.

glepnir avatar Aug 14 '23 09:08 glepnir

It seems like the issue with random freezes is not directly related to number of shortcuts (but rather to the the large number of long project (and MRU) entries).

I've managed to reproduce the issue by simply putting lots of identical project entries into the dashboard cache file.

Here is the ~/.cache/nvim/dashboard/cache file:

return { 
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
    "/this/is/a/very/long/path/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar/foo/bar",
}

(removing even one of the above entries fixes the freeze)

Here is my dashboard-nvim config I used to reproduce the issue:

-- snip
theme = 'hyper',
config = {
    shortcut = { {
        desc = 'Random entry',
    }, },

    project = { enable = true, limit = 999, },
    mru = { limit = 0 },
},
-- snip

Kihau avatar Sep 01 '23 19:09 Kihau

Should be fixed now! This issue can be marked as closed

Kihau avatar Sep 27 '23 10:09 Kihau