Project

General

Profile

Actions

Bug #7642

closed

IRB indentation is gone

Added by zzak (zzak _) over 11 years ago. Updated over 11 years ago.

Status:
Rejected
Target version:
ruby -v:
2.0.0
Backport:
[ruby-core:51209]

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.

Updated by zzak (zzak _) over 11 years ago

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

Updated by zzak (zzak _) over 11 years ago

  • Status changed from Open to Assigned

Updated by keiju (Keiju Ishitsuka) over 11 years 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.

Updated by zzak (zzak _) over 11 years ago

Thank you Keiju-san.

How do you enable auto-indent?

Updated by keiju (Keiju Ishitsuka) over 11 years ago

zzak (Zachary Scott) wrote:

Thank you Keiju-san.

How do you enable auto-indent?

For example, .irbrc:

IRB.conf[:PROMPT][:AUTO_INDENT] = {
:PROMPT_I => "%N(%m):%03n:%i> ",
:PROMPT_N => "%N(%m):%03n:%i> ",
:PROMPT_S => "%N(%m):%03n:%i%l ",
:PROMPT_C => "%N(%m):%03n:%i* ",
:RETURN => "=> %s\n",
:AUTO_INDENT => true
}

and, you do:

% irb --prompt auto-indent

Updated by zzak (zzak _) over 11 years ago

Keiju-san, thank you for the explanation.

I also found this method:

irb_context.auto_indent_mode = true

What do you think about enable this by default?

I can open a feature request.

Updated by keiju (Keiju Ishitsuka) over 11 years ago

  • Status changed from Assigned to Rejected

zzak (Zachary Scott) wrote:

I also found this method:
irb_context.auto_indent_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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0