Option to replace NBSP with regular whitespace #1456

Closed
prayerslayer opened this Issue Jan 4, 2014 · 0 comments

Comments

Projects
None yet
2 participants
@prayerslayer
Contributor

prayerslayer commented Jan 4, 2014

When typing something like object[ "key" ] on OSX, I often accidentally insert a non-breaking space (Option+Space) instead of a regular whitespace.

This bothers me for two reasons:

  1. I don't want to mix them because there is no semantic difference to a regular whitespace in my code. I should use NSBPs exactly when I want/need them there. Manually searching and replacing them is cumbersome though.
  2. It will cause a SyntaxError on pages without proper UTF-8 encoding. Even though I think that UTF-8 should be used at all times, this bug is hard to catch because a NBSP is mostly displayed as a regular whitespace.

To solve this I'd like to propose an option that detects NBSPs and maybe replaces them with regular whitespaces automatically. What do you think?

valueof added a commit that referenced this issue Jan 26, 2014

Issue #1456: New option - nonbsp (PR #1458)
Signed-off-by: Anton Kovalyov <anton@kovalyov.net>

valueof added a commit that referenced this issue Jan 26, 2014

@valueof valueof closed this Jan 26, 2014

jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014

Issue #1456: New option - nonbsp (PR #1458)
Signed-off-by: Anton Kovalyov <anton@kovalyov.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment