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

Indent lines are not shown in Python docstrings #77

Closed
serhez opened this issue Nov 14, 2023 · 8 comments
Closed

Indent lines are not shown in Python docstrings #77

serhez opened this issue Nov 14, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@serhez
Copy link

serhez commented Nov 14, 2023

Describe the bug
Indent lines are not shown in Python docstrings, as shown in the screenshot below.

To Reproduce
You can try the code in the screenshot. 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
I would expect the indent lines to be shown for the docstrings.

Screenshots
Screenshot 2023-11-14 at 17 07 54

@shellRaining
Copy link
Owner

This problem is still related to the treesitter option. Treesitter seems to determine that the docstring indentation of Python is 0 by default. To solve it, a lot of special judgments must be added, so it will not be fixed in the near future.

@serhez
Copy link
Author

serhez commented Nov 18, 2023

It seems that the best option for now is to disable the treesitter option then, thanks!

@shellRaining
Copy link
Owner

shellRaining commented Nov 18, 2023

In fact, except for this issue, I have fixed the previous two. If you can tolerate such a little bit of unsightliness, this option is still very nice~

I will push the patch to main brach later

@serhez
Copy link
Author

serhez commented Nov 18, 2023

In fact, except for this issue, I have fixed the previous two. If you can tolerate such a little bit of unsightliness, this option is still very nice~

I will push the patch to main brach later

What would you say are the advantages of the treesitter option? I've been using the plugin today with treesitter = false and I haven't noticed anything much different, besides the indent lines not occluding real text.

@shellRaining
Copy link
Owner

if use treesitter, the last line show like this

image

else

image

Using treesitter can reduce such visual interference, but I have plans to improve the display of the latter in the future.

@serhez
Copy link
Author

serhez commented Nov 18, 2023

That makes sense, thanks for the example! ❤️

@shellRaining shellRaining added the enhancement New feature or request label Nov 21, 2023
Repository owner deleted a comment Dec 24, 2023
@shellRaining
Copy link
Owner

fixed in dev branch, welcome to experience

@serhez
Copy link
Author

serhez commented May 31, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants