Increase FZF_DEFAULT_SORT to 1000

This commit is contained in:
Junegunn Choi 2013-11-16 11:50:38 +09:00
parent 4530819539
commit f0b2b98c5d
3 changed files with 6 additions and 6 deletions

View File

@ -73,7 +73,7 @@ usage: fzf [options]
-m, --multi Enable multi-select -m, --multi Enable multi-select
-x, --extended Extended-search mode -x, --extended Extended-search mode
-s, --sort=MAX Maximum number of matched items to sort. Default: 500 -s, --sort=MAX Maximum number of matched items to sort. Default: 1000
+s, --no-sort Do not sort the result. Keep the sequence unchanged. +s, --no-sort Do not sort the result. Keep the sequence unchanged.
+i Case-sensitive match +i Case-sensitive match
+c, --no-color Disable colors +c, --no-color Disable colors

4
fzf
View File

@ -69,7 +69,7 @@ class FZF
usage 0 unless (%w[--help -h] & argv).empty? usage 0 unless (%w[--help -h] & argv).empty?
@rxflag = argv.delete('+i') ? 0 : Regexp::IGNORECASE @rxflag = argv.delete('+i') ? 0 : Regexp::IGNORECASE
@sort = %w[+s --no-sort].map { |e| argv.delete e }.compact.empty? ? @sort = %w[+s --no-sort].map { |e| argv.delete e }.compact.empty? ?
ENV.fetch('FZF_DEFAULT_SORT', 500).to_i : nil ENV.fetch('FZF_DEFAULT_SORT', 1000).to_i : nil
@color = %w[+c --no-color].map { |e| argv.delete e }.compact.empty? @color = %w[+c --no-color].map { |e| argv.delete e }.compact.empty?
@multi = !%w[-m --multi].map { |e| argv.delete e }.compact.empty? @multi = !%w[-m --multi].map { |e| argv.delete e }.compact.empty?
@xmode = !%w[-x --extended].map { |e| argv.delete e }.compact.empty? @xmode = !%w[-x --extended].map { |e| argv.delete e }.compact.empty?
@ -111,7 +111,7 @@ class FZF
-m, --multi Enable multi-select -m, --multi Enable multi-select
-x, --extended Extended-search mode -x, --extended Extended-search mode
-s, --sort=MAX Maximum number of matched items to sort. Default: 500. -s, --sort=MAX Maximum number of matched items to sort. Default: 1000
+s, --no-sort Do not sort the result. Keep the sequence unchanged. +s, --no-sort Do not sort the result. Keep the sequence unchanged.
+i Case-sensitive match +i Case-sensitive match
+c, --no-color Disable colors] +c, --no-color Disable colors]

View File

@ -8,15 +8,15 @@ load 'fzf'
class TestFZF < MiniTest::Unit::TestCase class TestFZF < MiniTest::Unit::TestCase
def test_default_options def test_default_options
fzf = FZF.new [] fzf = FZF.new []
assert_equal 500, fzf.sort assert_equal 1000, fzf.sort
assert_equal false, fzf.multi assert_equal false, fzf.multi
assert_equal true, fzf.color assert_equal true, fzf.color
assert_equal Regexp::IGNORECASE, fzf.rxflag assert_equal Regexp::IGNORECASE, fzf.rxflag
begin begin
ENV['FZF_DEFAULT_SORT'] = '1000' ENV['FZF_DEFAULT_SORT'] = '1500'
fzf = FZF.new [] fzf = FZF.new []
assert_equal 1000, fzf.sort assert_equal 1500, fzf.sort
ensure ensure
ENV.delete 'FZF_DEFAULT_SORT' ENV.delete 'FZF_DEFAULT_SORT'
end end