Author Topic: .editorconfig broken?  (Read 214 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1902
  • Hero Points: 184
  • Text
.editorconfig broken?
« on: January 08, 2020, 11:59:00 pm »
When I update indent_style in .editorconfig, Slick doesn't seem to notice.

Repro:
1. Create .editorconfig with
Code: [Select]
[*]
indent_style = tab
indent_size = 4

2. In Notepad
Create "MyFile.foo" with a few lines of text.
Copy "MyFile.foo" to "MyFile_2.foo"

3. Open "MyFile.foo" in Slickedit.
Press <TAB>
Slick inserts a TAB.

4. Change "tab" to "space" in .editorconfig

5. Press <TAB>
Slick inserts a TAB.  ???

6. Open "MyFile_2.foo" in Slickedit.
Press <TAB>
Slick inserts a SPACES  :)


So it seems that the per-file settings that Slick keeps track of override the .editorconfig settings.
Slick remembers that it was in TAB mode for "MyFile.foo" even when you close and reopen it.

I'd like for .editorconfig to determine what happens here.
If I open a file, then explicitly change Document->IndentWithTabs, then sure it should override .editorconfig.
But otherwise, it oughta do what .editorconfig says.



Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5168
  • Hero Points: 427
Re: .editorconfig broken?
« Reply #1 on: January 09, 2020, 12:45:53 am »
This isn't caused by perfile.xml settings. This issue is caused by vrestore.slk (autorestore). We might be able to make auto-restore smarter. When the auto-restore information is saved, SOME settings are only saved if the settings are different from the defaults. I don't think that logic is applied for the indenting with tabs options (IWT in vrestore.slk). It's a bit more complicated that since this setting is actually an override from an external file but it's similar logic. I'll see if we can make auto-restore smarter.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5168
  • Hero Points: 427
Re: .editorconfig broken?
« Reply #2 on: January 09, 2020, 03:52:27 am »
Fixed in next hot fix build. Auto-restore needed to take overrides into account when comparing with the default settings.