mycoboco / wcwidth.js

a javascript porting of C's wcwidth()
http://code.woong.org/wcwidth.js
Other
12 stars 2 forks source link

control: 0 as default #7

Closed timoxley closed 10 years ago

timoxley commented 10 years ago

the default {control: -1} case is a bit surprising (to me at a least), makes more sense if control characters are just counted as 0 rather than invalidating the calculation completely.

mycoboco commented 10 years ago

The default value of -1 was to make uses consider and decide if their code really needs to handle control characters and how it should be done. If it confuses anyway, however, I don't disagree with changing it to 0.

mycoboco commented 10 years ago

Done in 9cda0b41e990c671b94f7f0abaed686ba0c05cc3