Skip to content

Don't necessarily override 'tabstop' when a file uses mixed spaces and tabs for indent #102

@jmdevin

Description

@jmdevin

In my .vimrc, I set 'tabstop' to 4. This normally applies to any new or existing files I open. However, when opening a file that mixes spaces and tabs for indenting*, sleuth forces 'tabstop' back to a value of 8. This messes with files that use 4-space tabs for indenting, but have some lines aligned with spaces. It would be extremely useful to be able to forbid sleuth from overriding 'tabstop' based on heuristics.

Context:
clang-format has a somewhat stupid behavior of not inserting a trailing comma when you want it to, but also changing some indents to use spaces if a trailing comma is missing (even though supposedly it's only supposed to use spaces inside lines, not for indenting). This isn't the only time I've encountered this problem with sleuth, it's just the first time I figured out what was going on.

*: "mixed tabs and spaces" here means lines that are indented only with tabs, or only with spaces, but never one with both, in the same file. I wonder if that matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions