Sublime Forum

Indendation detection / Single files

#1

First off, thank you for a great editor.

I have a problem with disabling the autodetection of a single files indendation setting.
I have tried updating the following places:

Preferences.sublime-settings – User

“tab_size”: 4
“translate_tab_to_spaces”: true
“detect_indendation”: false

.sublime-project

“settings”:
{
“detection_indendation”: false,
“tab_size”: 4,
“translate_tab_to_spaces”: true
}

I have two open files:

1 that uses 4 whitespaces as tab
1 that uses 2 whitespaces as tab

When I view 4 space file:

(from console)
view.settings().get(“tab_size”);
4

When I view 2 space file:
view.settings().get(“tab_size”);

So, for some reason it is still detecting the original tab size of the file.
How can I get sublime text to do explicitly as I tell it, and not autodetect the tab size from the file opened ?

Thanks in advance
Waveshaper

0 Likes

#2

When I view 2 space file:
view.settings().get(“tab_size”);
2

0 Likes

#3

I guess try spelling detect_indentation correctly in your preferences :slight_smile:

0 Likes

#4

Well, believe it or not, its not a copy paste of the file. :slight_smile:

So the miss-spelling is because I wrote it wrong in the example here in the forum.

But it is correctly spelled in the config file.

“detect_indentation”

Ok ?

0 Likes

#5

maybe you have a syntax specific preferences file that is overriding the project and general preferences tab_size?

0 Likes

#6

hmm. I think you are onto something …

I use sublime text under opensuse and I see now that I don’t have the rights to update the default settings file. Might this be overriding it…

0 Likes

#7

That did it :slight_smile:

Thanks for the reply

0 Likes

#8

The syntax file was overriding it that is :slight_smile:

0 Likes