Skip to content
Myr

Improve startup time

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 8f9dbc4 · Browse files · 1 file+11 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−8 removed

  • other:+11 added−8 removed

1 file+11 added−8 removed

modified:fzf+11 added-8 removed
1# vim: set filetype=ruby isk=@,48-57,_,192-255:2#!/usr/bin/env bash1#!/usr/bin/env ruby2# encoding: utf-83#4# ____ ____5# / __/___ / __/6# / /_/_ / / /_
27 unmodified lines
34# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION35# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION36# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.3738exec /usr/bin/env ruby -x "$0" $* 3>&1 1>&2 2>&339#!ruby40# encoding: utf-84138def usage x39 puts %[usage: fzf [options]4041 -s, --sort=MAX Maximum number of matched items to sort. Default: 500.
1 unmodified line
43 +i Case-sensitive match]44 exit x45end4647stdout = $stdout.clone48$stdout.reopen($stderr)4950usage 0 unless (%w[--help -h] & ARGV).empty?51@rxflag = ARGV.delete('+i') ? 0 : Regexp::IGNORECASE52@sort = (ARGV.delete('+s') || ARGV.delete('--no-sort')) ? nil : 50053rest = ARGV.join ' '
240 unmodified lines
294 plcount = 0 # prev list count295 q = ''296 vcursor = 0297 zz = [0, 0]298 started = false299300 begin301 while true302 wait_for_completion = nil
92 unmodified lines
395 end396 end#new_search397398 # This small delay reduces the number of partial lists399 sleep 0.2 unless user_input399 if started && !user_input400 sleep 0.2401 end402 started = true403404 if events.delete(:vcursor) || new_search405 @mtx.synchronize do406 plcount = [@matches.length, max_items].min
133 unmodified lines
540 end541 end542ensure543 C.close_screen541 $stderr.puts got if got544 stdout.puts got if got545end546