[前][次][番号順一覧][スレッド一覧]

ruby-changes:67327

From: aycabta <ko1@a...>
Date: Sun, 29 Aug 2021 20:31:16 +0900 (JST)
Subject: [ruby-changes:67327] 7857a1ab66 (master): [ruby/reline] Make autocomplete dialog is registered first

https://git.ruby-lang.org/ruby.git/commit/?id=7857a1ab66

From 7857a1ab661f44d7f51a0c636abf0ff953d2e8e8 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Sun, 29 Aug 2021 20:01:33 +0900
Subject: [ruby/reline] Make autocomplete dialog is registered first

https://github.com/ruby/reline/commit/d027dbe118
---
 lib/reline.rb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/reline.rb b/lib/reline.rb
index 7ec6fa2..188f1cb 100644
--- a/lib/reline.rb
+++ b/lib/reline.rb
@@ -44,10 +44,10 @@ module Reline https://github.com/ruby/ruby/blob/trunk/lib/reline.rb#L44
 
     def initialize
       self.output = STDOUT
+      @dialog_proc_list = []
       yield self
       @completion_quote_character = nil
       @bracketed_paste_finished = false
-      @dialog_proc_list = []
     end
 
     def encoding
@@ -220,7 +220,6 @@ module Reline https://github.com/ruby/ruby/blob/trunk/lib/reline.rb#L220
       unless confirm_multiline_termination
         raise ArgumentError.new('#readmultiline needs block to confirm multiline termination')
       end
-      add_dialog_proc(:autocomplete, Reline::DEFAULT_DIALOG_PROC_AUTOCOMPLETE, Reline::DEFAULT_DIALOG_CONTEXT)
       inner_readline(prompt, add_hist, true, &confirm_multiline_termination)
 
       whole_buffer = line_editor.whole_buffer.dup
@@ -474,6 +473,7 @@ module Reline https://github.com/ruby/ruby/blob/trunk/lib/reline.rb#L473
   def_single_delegators :core, :ambiguous_width
   def_single_delegators :core, :last_incremental_search
   def_single_delegators :core, :last_incremental_search=
+  def_single_delegators :core, :add_dialog_proc
 
   def_single_delegators :core, :readmultiline
   def_instance_delegators self, :readmultiline
@@ -495,6 +495,7 @@ module Reline https://github.com/ruby/ruby/blob/trunk/lib/reline.rb#L495
       core.completer_quote_characters = '"\''
       core.filename_quote_characters = ""
       core.special_prefixes = ""
+      core.add_dialog_proc(:autocomplete, Reline::DEFAULT_DIALOG_PROC_AUTOCOMPLETE, Reline::DEFAULT_DIALOG_CONTEXT)
     }
   end
 
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]