shellRaining / hlchunk.nvim

This is the lua implementation of nvim-hlchunk, you can use this neovim plugin to highlight your indent line and the current chunk (context) your cursor stayed
MIT License
628 stars 31 forks source link

Hidden text when unindented #76

Closed serhez closed 10 months ago

serhez commented 10 months ago

Describe the bug When I have unindented text (e.g., after copy-pasting code), much of the text is hidden by the indent lines.

To Reproduce Use my config with unindented text, such as the one shown in the screenshot below. My config:

chunk = {
    enable = true,
    use_treesitter = true,
    notify = true,
    chars = {
        horizontal_line = icons.bar.horizontal_thin,
        vertical_line = icons.bar.vertical_center_thin,
        left_top = icons.bar.upper_left_corner_thin,
        left_bottom = icons.bar.lower_left_corner_thin,
        right_arrow = icons.bar.horizontal_thin,
    },
    style = {
        {
            fg = c.info_fg,
        },
    },
    exclude_filetypes = {
        qf = true,
        help = true,
        dapui_scopes = true,
        dapui_watches = true,
        dapui_stacks = true,
        dapui_breakpoints = true,
        dapui_console = true,
        ["dap-repl"] = true,
        harpoon = true,
        dropbar_menu = true,
        glow = true,
        aerial = true,
        dashboard = true,
        lspinfo = true,
        lspsagafinder = true,
        packer = true,
        checkhealth = true,
        man = true,
        mason = true,
        NvimTree = true,
        ["neo-tree"] = true,
        plugin = true,
        lazy = true,
        TelescopePrompt = true,
        [""] = true, -- because TelescopePrompt will set a empty ft, so add this.
        alpha = true,
        toggleterm = true,
        sagafinder = true,
        sagaoutline = true,
        better_term = true,
        fugitiveblame = true,
        Trouble = true,
        Outline = true,
        starter = true,
        NeogitPopup = true,
        NeogitStatus = true,
        DiffviewFiles = true,
        DiffviewFileHistory = true,
        DressingInput = true,
        spectre_panel = true,
        zsh = true,
        vuffers = true,
    },
},

indent = {
    enable = true,
    use_treesitter = true,
    chars = {
        icons.bar.vertical_center_thin,
    },
    style = {
        {
            fg = c.comment_fg,
        },
    },
},

line_num = {
    enable = false,
},

blank = {
    enable = false,
    chars = {
        " ",
    },
    style = {
        {
            bg = c.bg,
        },
        {
            bg = c.cursor_line_bg,
        },
    },
},

Expected behavior To never have real text hidden by indent lines.

Screenshots Screenshot 2023-11-14 at 17 17 10

shellRaining commented 10 months ago

This issue is caused by the treesitter field being set, resulting in lines without correct indentation receiving correct indentation information, leading to overlapping during rendering.

will fix in next version