Skip to content
Myr

Add 'reading' marker

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 0c43811 · Browse files · 1 file+16 added−4 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+16 added−4 removed

  • other:+16 added−4 removed

1 file+16 added−4 removed

modified:fzf+16 added-4 removed
55 unmodified lines
56@count = 057@cursor_x = 058@vcursor = 059@matches = []60@fan = '-\|/-\|/'.split(//)61@stat = OpenStruct.new(:hit => 0, :partial_hit => 0,62 :prefix_hit => 0, :search => 0)6364def max_items; C.lines - 2; end65def cursor_y; C.lines - 1; end65def cprint str, col66 C.attron C.color_pair(col) | C::A_BOLD66def cprint str, col, flag = C::A_BOLD67 C.attron C.color_pair(col) | flag68 C.addstr str68 C.attroff C.color_pair(col) | C::A_BOLD69 C.attroff C.color_pair(col) | flag70end7172def print_input73 C.setpos cursor_y, 0
4 unmodified lines
7879def print_info msg = nil80 C.setpos cursor_y - 1, 081 C.clrtoeol81 C.addstr " #{@matches.length}/#{@count}#{msg}"82 prefix =83 if fan = @fan.shift84 @fan.push fan85 cprint fan, 5, 086 ' '87 else88 ' '89 end90 C.addstr "#{prefix}#{@matches.length}/#{@count}"91 C.addstr msg if msg92end9394def refresh95 C.setpos cursor_y, 2 + ulen(@query[0, @cursor_x])
34 unmodified lines
130C.init_pair 1, C::COLOR_BLUE, C::COLOR_BLACK131C.init_pair 2, C::COLOR_WHITE, C::COLOR_BLACK132C.init_pair 3, C::COLOR_YELLOW, C::COLOR_BLACK133C.init_pair 4, C::COLOR_RED, C::COLOR_BLACK134C.init_pair 5, C::COLOR_CYAN, C::COLOR_BLACK135136@read =137 if $stdin.tty?138 if !`which find`.empty?
11 unmodified lines
150 @new << line.chomp151 @cv.broadcast152 end153 end154 @smtx.synchronize { @fan = [] }155}156157searcher = Thread.new {158 fcache = {}
237 unmodified lines