1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/reline
aycabta b69c965f47 [ruby/reline] Cache pasting state in processing a key
Because it's too slow.

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.22sec -> 0.14sec

b8b3dd52c0
2021-02-07 05:09:18 +09:00
..
key_actor [ruby/reline] Bind yank-pop correctly 2020-12-19 02:12:11 +09:00
unicode [ruby/reline] Improve the performance of get_mbchar_width 2020-12-05 02:58:58 +09:00
ansi.rb [ruby/reline] Use plus operator to create unfrozen string 2020-12-17 20:20:07 +09:00
config.rb [ruby/reline] Correct var names in Reline were different from vi-*-mode-string 2021-01-08 13:25:18 +09:00
general_io.rb [ruby/reline] Call process_insert when the end of pasting plural fullwidth chars 2020-12-05 02:58:58 +09:00
history.rb [ruby/reline] Negative history_size means unlimited 2020-04-29 19:13:14 +09:00
key_actor.rb Add Reline as a fallback library for Readline 2019-04-30 11:44:20 +09:00
key_stroke.rb [ruby/reline] Use single quotes for non-expanded string literals 2020-08-18 19:08:11 +09:00
kill_ring.rb [ruby/reline] Add Enumerable to KillRing for debugging 2020-12-19 02:12:11 +09:00
line_editor.rb [ruby/reline] Cache pasting state in processing a key 2021-02-07 05:09:18 +09:00
reline.gemspec [ruby/reline] Add acknowledgments and license for rb-readline 2021-01-08 13:25:18 +09:00
unicode.rb [ruby/reline] Doesn't contain terminate spaces by cw 2020-12-24 23:26:22 +09:00
version.rb [ruby/irb] [ruby/irb] [ruby/reline] Version 0.2.2 2021-01-18 02:10:02 +09:00
windows.rb [ruby/reline] Reline::Windows.erase_after_cursor erases attributes too 2021-01-18 02:09:53 +09:00