Bug #7642

IRB indentation is gone

Added by Zachary Scott over 1 year ago. Updated over 1 year ago.

[ruby-core:51209]
Status:Rejected
Priority:Normal
Assignee:Keiju Ishitsuka
Category:lib
Target version:2.0.0
ruby -v:2.0.0 Backport:

Description

This is indentation of irb in 1.9.3-p362:
http://screencloud.net/v/srk8
It is ok, but no out-dent on 'end'. This could be fixed.

Now compare with irb in trunk:
http://screencloud.net/v/5uVd
Indentation is completely missing.

Associated revisions

Revision 39048
Added by Zachary Scott about 1 year ago

  • lib/irb.rb, lib/irb/context.rb: Add documentation on how to enable auto-indentation and autocompletion using irbrc and irb_context [Bug #7642] and [Bug #7680]

History

#1 Updated by Zachary Scott over 1 year ago

Here is another reproduction on 1.9.3-p327:
http://showterm.io/a12fb0188114e63df2e12

#2 Updated by Zachary Scott over 1 year ago

  • Status changed from Open to Assigned

#3 Updated by Keiju Ishitsuka over 1 year ago

zzak (Zachary Scott) wrote:

Here is another reproduction on 1.9.3-p327:
http://showterm.io/a12fb0188114e63df2e12

IRB default behavior is no auto-indent.
So, this is the correct behavior.

#4 Updated by Zachary Scott over 1 year ago

Thank you Keiju-san.

How do you enable auto-indent?

#5 Updated by Keiju Ishitsuka over 1 year ago

zzak (Zachary Scott) wrote:

Thank you Keiju-san.

How do you enable auto-indent?

For example, .irbrc:

IRB.conf[:PROMPT][:AUTOINDENT] = {
:PROMPT
I => "%N(%m):%03n:%i> ",
:PROMPTN => "%N(%m):%03n:%i> ",
:PROMPT
S => "%N(%m):%03n:%i%l ",
:PROMPTC => "%N(%m):%03n:%i* ",
:RETURN => "=> %s\n",
:AUTO
INDENT => true
}

and, you do:

% irb --prompt auto-indent

#6 Updated by Zachary Scott over 1 year ago

Keiju-san, thank you for the explanation.

I also found this method:

irbcontext.autoindent_mode = true

What do you think about enable this by default?

I can open a feature request.

#7 Updated by Keiju Ishitsuka over 1 year ago

  • Status changed from Assigned to Rejected

zzak (Zachary Scott) wrote:

I also found this method:
irbcontext.autoindent_mode = true

Yes. other way:

IRB.conf[:AUTO_INDENT] = true

What do you think about enable this by default?

Shell(bash, zsh) is also not default.
I do not think this feature is easy to use.
So, people who want to use this feature may be set it.

Also available in: Atom PDF