aboutsummaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-11-19 22:59:16 +0900
committeraycabta <aycabta@gmail.com>2020-12-05 02:58:59 +0900
commitb545ab219b40323373596eb45b43f2599a7a3c61 (patch)
tree7dfa83f23aca13e7a61547972750b3bacb790e82 /variable.c
parentfb2fda9a27ed96d5100897e93cc31e155b9c41a8 (diff)
downloadruby-b545ab219b40323373596eb45b43f2599a7a3c61.tar.gz
[ruby/reline] Stop rerendering whole screen when adding newline at end of buffer
The rendering time in IRB has been reduced as follows: start = Time.now def each_top_level_statement initialize_input catch(:TERM_INPUT) do loop do begin prompt unless l = lex throw :TERM_INPUT if @line == '' else @line_no += l.count("\n") next if l == "\n" @line.concat l if @code_block_open or @ltype or @continue or @indent > 0 next end end if @line != "\n" @line.force_encoding(@io.encoding) yield @line, @exp_line_no end break if @io.eof? @line = '' @exp_line_no = @line_no @indent = 0 rescue TerminateLineInput initialize_input prompt end end end end puts "Duration: #{Time.now - start} seconds" 0.33sec -> 0.22sec https://github.com/ruby/reline/commit/496c6a1892
Diffstat (limited to 'variable.c')
0 files changed, 0 insertions, 0 deletions