summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2014-01-30 03:12:12 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2014-01-30 03:12:12 +0900
commitc2943e7681767b75193657fbdcf2a378f588c38e (patch)
treecc4cb17c713622c8bc1a591102012ee7b46da723
parentc3676bf986c3f901c3b799735713d57b0341e167 (diff)
Fix `incompatible encoding regexp match` from width call
-rwxr-xr-xfzf2
1 files changed, 1 insertions, 1 deletions
diff --git a/fzf b/fzf
index aa6e81e1..5decd48d 100755
--- a/fzf
+++ b/fzf
@@ -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