Skip to content

On every edit of a file without tabs: You MUST use spaces! error #390

@eugenesvk

Description

@eugenesvk

I get this error on every single edit in a syntax file even if the file is almost emtpy (so guaranteed to have no tabs, and the syntax settings are also translate_tabs_to_spaces), which is very annoying

Tested with the TOML package, extracted syntax_test_toml.toml and replaced the content with an empty doc

# SYNTAX TEST "Packages/sublime_toml_highlighting/TOML.sublime-syntax"

# This is a TOML document. Boom.

Even if I switch to tabs and let the plugin switch back to spaces, I get this error

Since the source is https://github.com/SublimeText/PackageDev/blob/8d4ffb33e7e0b7bbf5dd5e8b3b9721615093c3dc/plugins/syntaxtest_dev.py#LL81C1-L87C62, maybe there is some issue with the plugin element gets __del__ too frequently invoked (or something)???

    def __del__(self):
        # Settings were (most likely) changed to use tabs
        # or plugin was unloaded.
        # Complain about the former, if we have a test file.
        if self.header and not self.is_applicable(self.view.settings()):
            sublime.error_message("Syntax tests do not work properly with tabs as indentation."
                                  "\n\nYou MUST use spaces!")

And this issue is not related to #177, where files had actual tabs, but just wanted to comment on the general approach

I know it's not really your syntax test file, but if it annoys enough people, someone might actually submit a PR to fix that

This is just bad design to annoy many people on the off chance a tiny number would fix the issue, that's just not that important a goal to impose such costs, and this can also get annoyances like this one that might not be related to tabs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions