Skip to content

allow disabling first level of scope indent  #824

@LokiNaBoki

Description

@LokiNaBoki

Problem

If you have the scope indents enabled, there is no option or hook to disable them in the first column.

As far as I can remember the show_first_indent_level option from V2 worked for both regular and scope indents. Now there is just hide_first_space_indent_level which hides only regular indents.

I made this hook to get rid of scope indents in the first column:

hooks.register(
    hooks.type.VIRTUAL_TEXT,
    function(_, _, _, virt_text)
        if virt_text[1] and virt_text[1][1] == '' then
            virt_text[1] = { ' ', { "@ibl.whitespace.char.1" } }
        end
                                                                 
        return virt_text
    end
)

but it feels really hacky. I have to hardcode the values: '┃' and { ' ', { "@ibl.whitespace.char.1" } }, instead of using indent.whitespace.INDENT and indent.whitespace.SPACE as in the built-in hook.

Expected behavior

The expected behavior is to have something like indent.whitespace enum, but for the scoped indents

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions