Closed dpashkevich closed 10 years ago
If possible, it seems like that should be the default setting (if not the only option). Project-specific settings seem like they should always override global settings.
It already does that but only on when loading files.
@sindresorhus Yeah this appears to work. So to make sure indent style is respected I have to create a new file, save it somewhere within project and then close it and reopen it. Can this be somehow improved? E.g. set indent style for the file view on first saving so I don't have to reopen it?
Doing it on pre_save is a bad idea since we're then changing stuff around right before persisting the file. Can consider doing it on file load too. Though I know there was a reason I didn't do it, but can't remember why.
@sindresorhus I'm not familiar with ST2 API but can a plugin detect if a project has been opened in current window? If so, a plugin could set editor settings right when a new view is opened. Of course that's not an ideal solution since I might create a new file but save it outside of my project directory (in this case .editorconfig rules should not apply) but it's a tradeoff that I would happily accept.
Currently it's a bit of a pain to work on a project with whitespace settings (stored in .editorconfig) that are different from my default preferences: every new file I create ends up having the wrong settings and most of the time I only realize this when reviewing changes before comitting... Obviously I don't create a new file every minute but that still happens relatively often. Would love to hear about any alternative solutions/workarounds.
I think on post-save
and load
is a good solution. It will then load the settings after you've saved your new file, since it can then pick up the right editorconfig settings or when you load a file. Wdyt?
But then it would happen everytime I save a file? If there would be no side effects from this, then I'm happy to have that feature :)
@dpashkevich it already does it on pre-save
Any progress on this?
Wondering about manual invocation also, specifically in bulk across a project.
Thanks!
Not sure if this is under plugin's control but here's the issue anyway.
I have a project (saved as a
.sublime-project
) with an.editorconfig
file in its root directory with the following contents:However, I also have
"translate_tabs_to_spaces": true
(my default preference) which always forces spaces in the new files that I create, even if I have a project withindent_style = tab
currently open in ST2 window. Is there a way editorconfig-sublime can override whitespace settings for new files that get saved in project directory so that.editorconfig
is always respected?