lukas-reineke / indent-blankline.nvim

Indent guides for Neovim
MIT License
4.17k stars 102 forks source link

v3: scope highlight weirdness #629

Closed OneOfOne closed 1 year ago

OneOfOne commented 1 year ago

It's like when you first get into a scope it uses the right color then it switches back to the default indent color. Also the scope char isn't respected, I don't think.

config:

    {
        'lukas-reineke/indent-blankline.nvim',
        branch = "v3",
        -- enabled = false,
        opts = function(_, opts)
            local highlight = {
                "Grey",
                -- "RainbowRed",
                -- "RainbowYellow",
                -- "RainbowBlue",
                -- "RainbowOrange",
                -- "RainbowGreen",
                -- "RainbowViolet",
                -- "RainbowCyan",
            }

            local hooks = require "ibl.hooks"
            -- create the highlight groups in the highlight setup hook, so they are reset
            -- every time the colorscheme changes
            hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
                vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#3f201e" })
                vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
                vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
                vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
                vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
                vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
                vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
            end)
            opts.char_highlight_list = highlight
            opts.char = "│"
            opts.scope = {
                enabled = true,
                char = "│",
                show_start = false,
                highlight = { "RainbowCyan" }
            }
            opts.indent = { highlight = highlight }
        end,
        config = function(_, opts)
            require('ibl').setup(opts)
            local hooks = require("ibl.hooks")
            hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
        end
    }

vid-2023-09-12_16.53.47.webm

lukas-reineke commented 1 year ago

Are you sure you don't have https://github.com/echasnovski/mini.indentscope installed as well?

You also have some issues in your configuration opts.char_highlight_list and opts.char don't exist, where did you get those from? Where does the Grey highlight group come from? And you don't need to define all the colors if you don't use them.

OneOfOne commented 1 year ago

You were correct, I had mini.indentscope installed (part of lazyvim's starter), disabling it fixed the issue.

I have the colors defined because I was playing with them, haven't decided yet on what I like.

I removed char_highlight_list and char since they didn't do anything.

It looks good now, great job man, thanks for your work!