mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-16 23:33:39 -05:00
Fix incompatible encoding regexp match from width call
This commit is contained in:
2
fzf
2
fzf
@@ -421,7 +421,7 @@ class FZF
|
|||||||
if RUBY_VERSION.split('.').map { |e| e.rjust(3, '0') }.join > '001009'
|
if RUBY_VERSION.split('.').map { |e| e.rjust(3, '0') }.join > '001009'
|
||||||
@@wrx = Regexp.new '\p{Han}|\p{Katakana}|\p{Hiragana}|\p{Hangul}'
|
@@wrx = Regexp.new '\p{Han}|\p{Katakana}|\p{Hiragana}|\p{Hangul}'
|
||||||
def width str
|
def width str
|
||||||
str.gsub(@@wrx, ' ').length
|
str.gsub(@@wrx, ' ').length rescue str.length
|
||||||
end
|
end
|
||||||
|
|
||||||
def trim str, len, left
|
def trim str, len, left
|
||||||
|
|||||||
Reference in New Issue
Block a user