Hyphen no longer used as word break on .html.erb files?


About a week ago, Atom stopped using hypens ("-") as word breaks on html.erb files. For example:


It used to treat “awesome” and “class” as separate words because of the hyphen “-” in between. I only have 7 community packages installed and I disabled all of them and it still treats hyphens as part of the word, so I think it’s an update in one of the core packages but I can’t figure out which one outside of disabling/enable them one at a time.

It only seems to have an issue on html.erb files (I’m using Ruby on Rails). CSS files still treat the hyphen as a word break.

I checked in the “Settings > Editor > Non Word Characters” and it is still using the default which includes the hyphen “-”.

I also updated the settings for my Ruby, Ruby-on-Rails, and HTML language packages and made sure their Non Word Characters included the hyphen and it didn’t seem to change anything.

Has anybody else experienced this change in the last week?

If it helps, I’m on a Macbook Air running High Sierra (10.13.2).


Hmmm, similar to https://github.com/atom/atom/issues/16366 and caused by https://github.com/atom/language-html/commit/4fa8731bf51456ae618379aaceb103d2bc2f0b17 @leroix?


Thanks! Taking care of these today.


@dlegr250 could you post a sample file for reproduction?



Below is a file snippet that reproduces the issue for me.

 <!-- sample_file.html.erb -->
<div class="awesome-class">
  Using: Atom 1.23.1, html-language package 0.48.4, with language-ruby-on-rails pacakge 0.25.2 `.html.erb` file extension.
  Above class "awesome-class" is considered one word and will not break on hypen "-".
  Verified that hyphen "-" is included in the Non Word Characters settings for both Atom Editor and html-language package.


Is this bug going to be fixed? I can also confirm that with a hyphen in the Non-word characters settings, Atom is still not treating it as a word-breaking character.



Ok, I think the best fix would be to add an editor.nonWordCharacters setting to https://github.com/atom/language-ruby/blob/master/settings/language-ruby.cson#L6. Recently, we fixed a bug in autocomplete-plus to correctly pull nonWordCharacters from the appropriate setting. Since text.html.erb doesn’t have this setting, we go to the next scope which is html. HTML doesn’t have - set as a nonWordCharacter.

There’s still a question in my mind whether it was a bug that text.html.erb previously viewed - as a non-word character since it contains html.

In the meantime, you can go to settings > packages > language-ruby and scroll down to HTML (RUBY - ERB) and add - to Non Word Characters.