mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Recognize half width characters
This commit is contained in:
@@ -81,6 +81,11 @@ isDoubleWidthCharacter = (character) ->
|
||||
isCjkUnifiedIdeograph(charCode) or
|
||||
isFullWidthForm(charCode)
|
||||
|
||||
isHalfWidthCharacter = (character) ->
|
||||
charCode = character.charCodeAt(0)
|
||||
|
||||
0xFF65 <= charCode <= 0xFFDC
|
||||
|
||||
# Does the given string contain at least surrogate pair, variation sequence,
|
||||
# or combined character?
|
||||
#
|
||||
@@ -94,4 +99,4 @@ hasPairedCharacter = (string) ->
|
||||
index++
|
||||
false
|
||||
|
||||
module.exports = {isPairedCharacter, hasPairedCharacter, isDoubleWidthCharacter}
|
||||
module.exports = {isPairedCharacter, hasPairedCharacter, isDoubleWidthCharacter, isHalfWidthCharacter}
|
||||
|
||||
Reference in New Issue
Block a user