ruby-changes:64465
From: aycabta <ko1@a...>
Date: Tue, 22 Dec 2020 23:51:20 +0900 (JST)
Subject: [ruby-changes:64465] 294552ca6c (master): [ruby/reline] Render refreshed prompt just after i-search finished
https://git.ruby-lang.org/ruby.git/commit/?id=294552ca6c From 294552ca6c38b90a2be257727ce5df69b93a4de7 Mon Sep 17 00:00:00 2001 From: aycabta <aycabta@g...> Date: Mon, 21 Dec 2020 23:02:46 +0900 Subject: [ruby/reline] Render refreshed prompt just after i-search finished https://github.com/ruby/reline/commit/0d3188fe34 diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 3637941..0584df3 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1614,6 +1614,8 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L1614 @waiting_proc = nil @cursor_max = calculate_width(@line) @cursor = @byte_pointer = 0 + @rerender_all = true + @cached_prompt_list = nil searcher.resume(-1) when "\C-g".ord if @is_multiline @@ -1657,6 +1659,8 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L1659 @waiting_proc = nil @cursor_max = calculate_width(@line) @cursor = @byte_pointer = 0 + @rerender_all = true + @cached_prompt_list = nil searcher.resume(-1) end end diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb index 8468729..85818e5 100644 --- a/test/reline/yamatanooroti/test_rendering.rb +++ b/test/reline/yamatanooroti/test_rendering.rb @@ -399,6 +399,17 @@ begin https://github.com/ruby/ruby/blob/trunk/test/reline/yamatanooroti/test_rendering.rb#L399 EOC end + def test_multiline_incremental_search_finish + start_terminal(6, 25, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.') + write("def a\n 8\nend\ndef b\n 3\nend\C-r8\C-j") + close + assert_screen(<<~EOC) + prompt> def a + prompt> 8 + prompt> end + EOC + end + def test_binding_for_vi_movement_mode write_inputrc <<~LINES set editing-mode vi -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/