lukas-reineke / indent-blankline.nvim

Indent guides for Neovim
MIT License
4.19k stars 104 forks source link

'char' is not a valid key of ibl.config.scope #672

Closed CharlesChiuGit closed 1 year ago

CharlesChiuGit commented 1 year ago

Problem

In v3.2.3, ibl.config.scope.char doesn't seem to be a valid key, but it shows in the help page. So what's the right way to config it? tks!

image

Steps to reproduce

ibl config:

return function()
    require("ibl").setup({
        enabled = true,
        debounce = 200,
        indent = {
            char = "│",
            tab_char = "│",
            smart_indent_cap = true,
            priority = 2,
        },
        whitespace = { remove_blankline_trail = true },
        -- Note: Scope requires treesitter to be set up
        scope = {
            enabled = true,
            char = "┃",
            show_start = false,
            show_end = false,
            injected_languages = true,
            priority = 1000,
            include = {
                node_type = {
                    ["*"] = {
                        "argument_list",
                        "arguments",
                        "assignment_statement",
                        "Block",
                        "chunk",
                        "class",
                        "ContainerDecl",
                        "dictionary",
                        "do_block",
                        "do_statement",
                        "element",
                        "except",
                        "FnCallArguments",
                        "for",
                        "for_statement",
                        "function",
                        "function_declaration",
                        "function_definition",
                        "if_statement",
                        "IfExpr",
                        "IfStatement",
                        "import",
                        "InitList",
                        "list_literal",
                        "method",
                        "object",
                        "ParamDeclList",
                        "repeat_statement",
                        "selector",
                        "SwitchExpr",
                        "table",
                        "table_constructor",
                        "try",
                        "tuple",
                        "type",
                        "var",
                        "while",
                        "while_statement",
                        "with",
                    },
                },
            },
        },
        exclude = {
            filetypes = {
                "", -- for all buffers without a file type
                "alpha",
                "big_file_disabled_ft",
                "dashboard",
                "dotooagenda",
                "flutterToolsOutline",
                "fugitive",
                "git",
                "gitcommit",
                "help",
                "json",
                "log",
                "markdown",
                "NvimTree",
                "Outline",
                "peekaboo",
                "startify",
                "TelescopePrompt",
                "todoist",
                "txt",
                "undotree",
                "vimwiki",
                "vista",
            },
            buftypes = { "terminal", "nofile", "quickfix", "prompt" },
        },
    })
end

Expected behavior

ibl.config.scope.char is a valid key.

Neovim version (nvim -v)

NVIM v0.9.2

lukas-reineke commented 1 year ago

Pushed a fix

CharlesChiuGit commented 1 year ago

tks! it works properly now.

pkropachev commented 1 year ago

Hi!

I use LazyVim config for NeoVim and see the following warning each time open file in Nvim.

scr1

It looks like I use the latest version from master.

scr2

Could you please advise what the reason can be?

lukas-reineke commented 1 year ago

That error is correct, char is not a valid key there. it's either :help ibl.config.indent.char or :help ibl.config.scope.char