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

bug: Dashboard: attempt to perform arithmetic on field 'pane_gap' #700

Open
4 tasks done
azinsharaf opened this issue Jan 22, 2025 · 0 comments
Open
4 tasks done
Labels
bug Something isn't working

Comments

@azinsharaf
Copy link

azinsharaf commented Jan 22, 2025

Did you check docs and existing issues?

  • I have read all the snacks.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of snacks.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.11.0-dev-591+gf35d5afbf

Operating system/version

Windows Pro 10

Describe the bug

using the advanced sample dashboard configuration returns an error.
https://github.com/folke/snacks.nvim/blob/main/docs/dashboard.md#advanced

error:

Error detected while processing UIEnter Autocommands for "*":
Error executing lua callback: ...ocal/nvim-data/lazy/snacks.nvim/lua/snacks/dashboard.lua:584: attempt to perform arithmetic on field 'pane_gap' (a nil v
alue)
stack traceback:
        ...ocal/nvim-data/lazy/snacks.nvim/lua/snacks/dashboard.lua:584: in function 'layout'
        ...ocal/nvim-data/lazy/snacks.nvim/lua/snacks/dashboard.lua:696: in function 'update'
        ...ocal/nvim-data/lazy/snacks.nvim/lua/snacks/dashboard.lua:228: in function 'open'
        ...ocal/nvim-data/lazy/snacks.nvim/lua/snacks/dashboard.lua:1151: in function 'enable'
        ...ata/Local/nvim-data/lazy/snacks.nvim/lua/snacks/init.lua:141: in function 'load'
        ...ata/Local/nvim-data/lazy/snacks.nvim/lua/snacks/init.lua:157: in function <...ata/Local/nvim-data/lazy/snacks.nvim/lua/snacks/init.lua:156>
Press ENTER or type command to continue

snacks.lua config file:

return {
	"folke/snacks.nvim",
	priority = 1000,
	lazy = false,
	---@type snacks.Config
	opts = {
		-- your configuration comes here
		-- or leave it empty to use the default settings
		-- refer to the configuration section below
		bigfile = { enabled = true, syntax = false },
		dashboard = {
			enabled = true,

			{
				sections = {
					{ section = "header" },
					{
						pane = 2,
						section = "terminal",
						cmd = "colorscript -e square",
						height = 5,
						padding = 1,
					},
					{ section = "keys", gap = 1, padding = 1 },
					{
						pane = 2,
						icon = " ",
						title = "Recent Files",
						section = "recent_files",
						indent = 2,
						padding = 1,
					},
					{ pane = 2, icon = " ", title = "Projects", section = "projects", indent = 2, padding = 1 },
					{
						pane = 2,
						icon = " ",
						title = "Git Status",
						section = "terminal",
						enabled = function()
							return Snacks.git.get_root() ~= nil
						end,
						cmd = "git status --short --branch --renames",
						height = 5,
						padding = 1,
						ttl = 5 * 60,
						indent = 3,
					},
					{ section = "startup" },
				},
			},
		},
		indent = { enabled = true },
		input = { enabled = true },
		notifier = { enabled = true },
		quickfile = { enabled = true },
		scroll = { enabled = true },
		statuscolumn = { enabled = true },
		words = { enabled = true },
	},
}

Steps To Reproduce

using the snack.lua config file mentioned above returns error.

Expected Behavior

no error

Repro

@azinsharaf azinsharaf added the bug Something isn't working label Jan 22, 2025
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

1 participant