m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Fix ^.*$ pattern matching in extended-search mode (#9)

This commit is contained in:
Junegunn Choi
2013-12-09 14:46:06 +09:00
parent 04ebaddf5e
commit cb3645ea95
3 changed files with 18 additions and 2 deletions

4
fzf
View File

@@ -347,7 +347,7 @@ class FZF
tokens << [line[b...e], true]
index = e
end
tokens << [line[index..-1], false]
tokens << [line[index..-1], false] if index < line.length
tokens.reject { |pair| pair.first.empty? }
end
@@ -829,6 +829,8 @@ class FZF
case w
when ''
nil
when /^\^(.*)\$$/
Regexp.new('^' << sanitize(Regexp.escape $1) << '$', rxflag)
when /^'/
w.length > 1 ?
Regexp.new(sanitize(Regexp.escape(w[1..-1])), rxflag) : nil