atom / language-css

CSS package for Atom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hyphen incorrectly counting as word character

Rockster160 opened this issue · comments

Prerequisites

Description

When selecting a word/traversing words in any css file, it no longer respects a hyphen as a non-word character.

Steps to Reproduce

  1. Add a selector with a hyphen to any CSS file.
  2. Place cursor inside of one of the words
  3. CMD+D / Editor: Select Word to select the word
  4. It selects the entire selector instead of only the expected word. 😞

Expected behavior:
For the class: "my-container" with your cursor on the word container, Editor: Select Word should highlight/select ONLY container.

Actual behavior:
Currently selects the entire "my-container" selector. Not only is this not expected, it's also inconsistent with other similar languages. (HTML/JS packages)

Reproduces how often: 100%

Versions

MacOS High Sierra : 10.13.6
Atom : 1.29.0
Electron: 2.0.5
Chrome : 61.0.3163.100
Node : 8.9.3
language-css : 0.42.11

Same goes for double clicking.

A few months ago (I can't quite remember what version this happened) Atom didn't have this issue. Was this intentional, or is it a bug?

@hugobaeta - I think this was intentional as a hack to get around another bug where hyphenated words weren't being auto-completed properly. I don't personally see breaking current functionality to try to atone for that as the right solution though, personally. 😕

@Rockster160 I see. Well, I can tell you that if you work with BEM naming convention, not being able to quickly select portions of the selector is super annoying :D

Completely agreed, which is why I think this should definitely be classified as a bug that needs fixing.

I am not sure why this was changed or if it was changed intentionally. But you can configure this from the language-css settings:

Just remove the - character from here.

image

I am having exactly this same issue. Are there any updates or fixes on this?

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.