Settings from the .editorconfig file are applied inside ReadProperties() method. ReadProperties() is often followed by SetIndentSettings() and SetEol(), which know nothing about the .editorconfig file and apply settings from properties.
As a result, settings from the .editorconfig file are not applied correctly when opening files from the command line. If you open files from the menu, the settings are applied correctly, but this is rather luck.
I tried to fix it myself.
Committed as [868a64] .
Related
Commit: [868a64]
Unfortunately this change was too aggressive - the changes made to props would often persist to unrelated files since they are not removed when a different .editorconfig or .editorconfig mode is active. A different mechanism is needed where these settings only last for the file they refer to.
Backed out with [b3630f] .
Related
Commit: [b3630f]
In my opinion, it is enough to replace props.Set with propsLocal.Set. Or maybe propsDiscovered.Set would be better?
Patch with propsDiscovered.Set
Committed as [2c1b93] . A subsequent change [118b3f] extracted ReadEditorConfig as a separate method.
Related
Commit: [118b3f]
Commit: [2c1b93]