user3141711
user3141711

Reputation: 23

Sublime Text 3 translate tabs to space feature doesn't work

I've started to learn Haskell today. I've chosen Sublime Text 3 with SublimeHaskell plugin as my IDE. Everything works fine, but when I compile a code the following warning appears:

Tab character found here. Please use spaces instead.

I've heard that Haskell is white-space sensitive and if tabs really cause some flaws or even bugs why shouldn't I get rid of it?

Unfortunately, when I set "translate_tabs_to_spaces": true it didn't really help much, the editor doesn't convert any tabs at all. How can I fix that?

My user config:

{
    "color_scheme": "Packages/SublimeHaskell/Themes/Hasky(Dark).tmTheme",
    "dictionary": "Packages/Dictionaries/Polish.dic",
    "font_size": 8,
    "ignored_packages":
    [
        "Vintage"
    ],
    "translate_tabs_to_spaces": true,
    "detect_indentation": false,    
}

Upvotes: 1

Views: 1028

Answers (1)

Devyzr
Devyzr

Reputation: 347

I had the same problem, I assume it has something to do with the "detect_indentation" setting, since I had to manually replace all tabs for spaces and then close the file and open it again for "translate_tabs_to_spaces" to work. Note that restarting sublime doesn't work, you need to close the specific file(s) that are causing the problem. I assume this is because sublime saves your settings at close.

IMHO this is preferable to having indentation errors because you changed workstations, but it would be nice if sublime would be a bit more verbose about it.

Upvotes: 2

Related Questions