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

Chunk guides hidden behind indent guides #107

Closed
serhez opened this issue Jun 10, 2024 · 5 comments
Closed

Chunk guides hidden behind indent guides #107

serhez opened this issue Jun 10, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@serhez
Copy link

serhez commented Jun 10, 2024

Describe the bug
The chunk guides are most of the time partially hidden behind the indent guides (see video attached).

To Reproduce
Scroll up and down in code with nested indentation. My config is below; you may need to replace the references to my color and icons helpers. I've also tried setting chunk.use_treesitter = false but it doesn't help.

require("hlchunk").setup({
    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,
        },
        textobject = "ic",
        style = {
            {
                fg = c.info_fg, -- no error
            },
            {
                fg = c.error_fg, -- error
            },
        },
        -- FIX: The animation creates artifacts when moving the cursor fast
        -- duration = 150,
        -- delay = 1,
        duration = 0,
        delay = 0,
    },
    
    indent = {
        enable = true,
        use_treesitter = false,
        chars = {
            icons.bar.vertical_center_thin,
        },
        style = {
            {
                fg = c.comment_fg,
            },
        },
        delay = 0,
    },
    
    line_num = {
        enable = false,
    },
    
    blank = {
        enable = false,
    },
})

Expected behavior
The chunk guides should have preference over indent guides.

Screenshots

Screen.Recording.2024-06-10.at.10.40.59.mov
@shellRaining
Copy link
Owner

shellRaining commented Jun 10, 2024

Sorry, the previous issue was not explained clearly. The indent mod does not need to set the use_treesitter option to true, but chunk still relies more on treesitter (because they work differently). I will mention this in next version

as for the bug, I can't reproduce it. are you using the latest commit on the main branch?

And you can try to set priority field to a large number, maybe this can solve, default priority is 15

bug_reproduce.mov

@serhez
Copy link
Author

serhez commented Jun 10, 2024

@shellRaining Thanks for the explanation! I tried setting a higher priority for the chunk mod, but this doesn't solve the issue. Could you try reproducing with my config or sharing yours? It's strange that we wouldn't get the same behavior.

@shellRaining
Copy link
Owner

I'll take a look at your dotfile, by the way, your color scheme looks great!

@shellRaining
Copy link
Owner

I found the reason, it is because your configuration file using tabs instead of spaces, and I did not handle the relevant parts correctly.

And I also found that you have list a long exclude_filetypes table, which now can just list what you need, it will appended to the exclude_filetypes I have collected automatically~

@shellRaining shellRaining added the bug Something isn't working label Jun 10, 2024
@serhez
Copy link
Author

serhez commented Jun 10, 2024

@shellRaining Ok perfect! ❤️

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

2 participants