Skip to content
Permalink
Browse files

Auto indent in IRB is enabled by default

  • Loading branch information...
aycabta committed Jul 14, 2019
1 parent 82b058f commit 6d573691058b353840c504d16cc2df1eb0bb517c
Showing with 8 additions and 8 deletions.
  1. +3 −3 lib/irb.rb
  2. +4 −4 lib/irb/context.rb
  3. +1 −1 lib/irb/init.rb
@@ -110,9 +110,9 @@
#
# === Auto indentation
#
# To enable auto-indent mode in irb, add the following to your +.irbrc+:
# To disable auto-indent mode in irb, add the following to your +.irbrc+:
#
# IRB.conf[:AUTO_INDENT] = true
# IRB.conf[:AUTO_INDENT] = false
#
# === Autocompletion
#
@@ -141,7 +141,7 @@
# This example can be used in your +.irbrc+
#
# IRB.conf[:PROMPT][:MY_PROMPT] = { # name of prompt mode
# :AUTO_INDENT => true, # enables auto-indent mode
# :AUTO_INDENT => false, # disables auto-indent mode
# :PROMPT_I => ">> ", # simple prompt
# :PROMPT_S => nil, # prompt for continuated strings
# :PROMPT_C => nil, # prompt for continuated statement
@@ -194,17 +194,17 @@ def main
# Can be either the default <code>IRB.conf[:AUTO_INDENT]</code>, or the
# mode set by #prompt_mode=
#
# To enable auto-indentation in irb:
# To disable auto-indentation in irb:
#
# IRB.conf[:AUTO_INDENT] = true
# IRB.conf[:AUTO_INDENT] = false
#
# or
#
# irb_context.auto_indent_mode = true
# irb_context.auto_indent_mode = false
#
# or
#
# IRB.CurrentContext.auto_indent_mode = true
# IRB.CurrentContext.auto_indent_mode = false
#
# See IRB@Configuration for more information.
attr_accessor :auto_indent_mode
@@ -105,7 +105,7 @@ def IRB.init_config(ap_path)
}

@CONF[:PROMPT_MODE] = (STDIN.tty? ? :DEFAULT : :NULL)
@CONF[:AUTO_INDENT] = false
@CONF[:AUTO_INDENT] = true

@CONF[:CONTEXT_MODE] = 3 # use binding in function on TOPLEVEL_BINDING
@CONF[:SINGLE_IRB] = false

0 comments on commit 6d57369

Please sign in to comment.
You can’t perform that action at this time.