Add regression test case for #91

This commit is contained in:
Junegunn Choi
2014-08-17 00:22:22 +09:00
parent 75b44aac13
commit 2924fd3e23
2 changed files with 19 additions and 3 deletions

5
fzf
View File

@@ -366,7 +366,8 @@ class FZF
end if str
end
def addstr_safe str
C.addstr str.gsub("\0", '')
str = str.gsub("\0", '') rescue str
C.addstr str
end
def print_input
@@ -1105,7 +1106,7 @@ class FZF
begin
unless @delim
# AWK default
prefix_length = (str.index(/\S/) rescue 0)|| 0
prefix_length = (str.index(/\S/) || 0) rescue 0
tokens = str.scan(/\S+\s*/) rescue []
else
prefix_length = 0