Skip to content

Loading…

Option to replace NBSP with regular whitespace #1456

Closed
prayerslayer opened this Issue · 0 comments

2 participants

@prayerslayer

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 valueof added a commit that referenced this issue
@prayerslayer prayerslayer Issue #1456: New option - nonbsp (PR #1458)
Signed-off-by: Anton Kovalyov <anton@kovalyov.net>
3cb02e3
@valueof valueof added a commit that referenced this issue
@valueof valueof Issue #1456: New option - nonbsp 4ec8297
@valueof valueof closed this
@jugglinmike jugglinmike added a commit to jugglinmike/jshint that referenced this issue
@prayerslayer prayerslayer Issue #1456: New option - nonbsp (PR #1458)
Signed-off-by: Anton Kovalyov <anton@kovalyov.net>
199d762
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.