favish / atom-drupal

Drupal snippets, filetypes and hotkeys for the Atom Editor
MIT License
28 stars 14 forks source link

Tab length doesn't seem to work #8

Open verheyenkoen opened 9 years ago

verheyenkoen commented 9 years ago

I have my general tab length set to 4, and for atom-drupal I want to use 2 (as specified in the Drupal coding standards). However, the files with extensions specified in File Types PHPsetting don't seem to have this setting applied.

robballou commented 9 years ago

atom-drupal and language-php don't set the tab settings. It's probably worth a discussion on if that should be set or not at the atom-drupal level.

In the meantime, you can also set it via language-specific settings: https://atom.io/docs/latest/using-atom-basic-customization

I think atom-drupal could easily add this to help people write per the Drupal coding spec. I'm curious what others think. Here's an example of Python settings which sets it to 4 spaces (Python's spec): https://github.com/atom/language-python/blob/master/settings/language-python.cson

verheyenkoen commented 9 years ago

Ok, I guess I was already referring to language-specific settings (which appear under the package settings). I thought that was a package specific feature. So the bug should be in Atom core.

robballou commented 9 years ago

I don't think it's a bug in core unless adding the settings don't work. Looking closer at atom-drupal we may need to do slightly more than just including a settings file to make a change but it's probably still possible.

I think if you add this to your config, you will get what you want for language-php. Unless you want it different for Drupal v. general PHP...

'.text.html.php':
  'editor':
    'tabLength': 2

Hope that helps!

verheyenkoen commented 9 years ago

Can't get it to work like this. It seems to work for the first 2 "tabs" on a line but no further. Also the tab indicator lines don't show correctly. Will see if I find a bug report on the grammar feature.