Closed samselikoff closed 5 years ago
I don't see how that's possible as it requires a file path which it only get's from a saved file.
No code goes past this when there's no file path: https://github.com/sindresorhus/editorconfig-sublime/blob/79b466e0eee57ef0b8fa50b96350a60543778446/EditorConfig.py#L42
Sure there isn't some other plugin doing this?
Hm, that's strange. I uninstalled EditorConfig just to make sure, and it does seem to be responsible.
Let me know if there's any other info I can provide.
I'm seeing this too. I have tab_size: 2
and detect_indentation: false
in my Sublime Settings, but when I open JavaScript file (in a project without an .editorconfig
file), it defaults to 4 space indentation.
If I disable the plugin, restart and reopen the same file, the indentation is 2 spaces (like it should be)
When this EditorConfig plugin is active, it overrides Sublime's indentation auto-detection with its own defaults in the absence of an .editorconfig
file. The screenshot below shows what happens when a file is selected in the sidebar and then opened in preview mode. You can see that Sublime is correctly trying to set the indentation to 4 spaces (arrow on the left), but is overridden (arrow on the right). Uninstalling the plugin restores Sublime's proper auto-indentation detection and settings.
I lost >1h today trying to figure out what plugin was fucking with all my files.
God help you if you try to save Preferences.sublime-settings
because it'll corrupt that file too.
Why isn't' the default, do nothing?
Experienced this issue too multiple times.
If there is no .editorconfig
file the plugin should indeed do nothing.
Seems to be caused by an .editorconfig
file in your user folder ~/.editorconfig
.
If that is removed, it works like expected.
Seems to be caused by an .editorconfig file in your user folder ~/.editorconfig. If that is removed, it works like expected.
That's how EditorConfig works. It searches upwards until it find a .editorconfig
file.
Closing as it's working per EditorConfig behavior. If you don't like the behavior, you should open an issue here: https://github.com/editorconfig/editorconfig-core-py
Editorconfig seems to be overriding my user preferences for new files with no
.editorconfig
file. In my Sublime preferences, I haveand yet new files start out with 4 spaces set as their default.
Is there any way to set this default within Editorconfig? I don't see any preferences under Preferences -> Package Settings.