Fix incompatible encoding regexp match from width call

This commit is contained in:
Junegunn Choi 2014-01-30 03:12:12 +09:00
parent c3676bf986
commit c2943e7681

2
fzf
View File

@ -421,7 +421,7 @@ class FZF
if RUBY_VERSION.split('.').map { |e| e.rjust(3, '0') }.join > '001009'
@@wrx = Regexp.new '\p{Han}|\p{Katakana}|\p{Hiragana}|\p{Hangul}'
def width str
str.gsub(@@wrx, ' ').length
str.gsub(@@wrx, ' ').length rescue str.length
end
def trim str, len, left