From 60a523b9f03144b82cbfed7f0158dc73a9b118d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Doma=C5=84ski?= Date: Tue, 15 Oct 2024 14:09:43 +0200 Subject: [PATCH] Disable autocompletions by default --- lib/irb/init.rb | 2 +- test/irb/test_context.rb | 2 +- test/irb/test_init.rb | 2 +- test/irb/test_type_completor.rb | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/irb/init.rb b/lib/irb/init.rb index d474bd41d..ee07862cd 100644 --- a/lib/irb/init.rb +++ b/lib/irb/init.rb @@ -79,7 +79,7 @@ def IRB.init_config(ap_path) @CONF[:USE_SINGLELINE] = false unless defined?(ReadlineInputMethod) @CONF[:USE_COLORIZE] = (nc = ENV['NO_COLOR']).nil? || nc.empty? - @CONF[:USE_AUTOCOMPLETE] = ENV.fetch("IRB_USE_AUTOCOMPLETE", "true") != "false" + @CONF[:USE_AUTOCOMPLETE] = ENV.fetch("IRB_USE_AUTOCOMPLETE", "false") != "false" @CONF[:COMPLETOR] = ENV["IRB_COMPLETOR"]&.to_sym @CONF[:INSPECT_MODE] = true @CONF[:USE_TRACER] = false diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index 9fa23ccce..71f256d8b 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -215,7 +215,7 @@ def inspect end def test_default_config - assert_equal(true, @context.use_autocomplete?) + assert_equal(false, @context.use_autocomplete?) end def test_echo_on_assignment diff --git a/test/irb/test_init.rb b/test/irb/test_init.rb index f7168e02f..99b79b60b 100644 --- a/test/irb/test_init.rb +++ b/test/irb/test_init.rb @@ -145,7 +145,7 @@ def test_use_autocomplete_environment_variable ENV['IRB_USE_AUTOCOMPLETE'] = nil IRB.setup(__FILE__) - assert IRB.conf[:USE_AUTOCOMPLETE] + refute IRB.conf[:USE_AUTOCOMPLETE] ENV['IRB_USE_AUTOCOMPLETE'] = '' IRB.setup(__FILE__) diff --git a/test/irb/test_type_completor.rb b/test/irb/test_type_completor.rb index 3d0e25d19..2697eed88 100644 --- a/test/irb/test_type_completor.rb +++ b/test/irb/test_type_completor.rb @@ -101,7 +101,6 @@ def test_type_completor type "puts completor.doc_namespace 'a = n.chr;', 'a.encoding', '', bind: binding" type "exit!" end - assert_match(/Completion: Autocomplete, ReplTypeCompletor/, output) assert_match(/a\.bit_length/, output) assert_match(/String#encoding/, output) end