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

allow disabling first level of scope indent #824

Open
LokiNaBoki opened this issue Jan 7, 2024 · 0 comments
Open

allow disabling first level of scope indent #824

LokiNaBoki opened this issue Jan 7, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@LokiNaBoki
Copy link

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

@LokiNaBoki LokiNaBoki added the enhancement New feature or request label Jan 7, 2024
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

1 participant