Possible Bug with Language-specific Configuration?


#1

I’m getting some strange behaviour when adding language-specific configuration. All I’m trying to do is enable softWrap for Markdown files. Using the Atom docs found here, I’m adding the following to config.cson:

"*":
  ...
".source.gfm":
  editor:
    softWrap: true

However, if I save the file, close Atom’s Config Folder, then return and view config.cson, I see that it has been altered to the following:

"*":
  ...
".gfm.source":
  editor:
    softWrap: true

This doesn’t enable softwrap for Markdown files.

I have tried this using atom --safe with the same result. Is this a bug or am I missing something obvious?


#2

The same holds true for any language, for example:

".source.ruby":
  editor:
    softWrap: true

Is converted to

".ruby.source":
  editor:
    softWrap: true

#3

That’s because it doesn’t matter what order it’s in :slight_smile:. They’re equivalent. I’ll look into why it doesn’t work though in a bit.


#4

Ah. Thanks. That makes sense. Don’t think it’s mentioned in the docs though. Just found the reason it wasn’t working and was unrelated to this.


#5

I have this in my config:

".gfm.source":
  editor:
    showInvisibles: false
    softWrap: true
    tabLength: 4

And all of these settings work correctly for “GitHub Markdown”. Is that what it says in your status bar when you’re editing Markdown files?


#6

Thanks. Problem was actually elsewhere, but all the docs show the scope as formatted “.source.gfm” so I incorrectly supposed that the problem lay there. In fact I needed to tweak two settings instead of one to get the effect I was after.