Forum: Ruby-core [ruby-trunk - Bug #7642][Open] IRB indentation is gone

Posted by zzak (Zachary Scott) (Guest)
on 2012-12-31 18:08
(Received via mailing list)
Issue #7642 has been reported by zzak (Zachary Scott).

----------------------------------------
Bug #7642: IRB indentation is gone
https://bugs.ruby-lang.org/issues/7642

Author: zzak (Zachary Scott)
Status: Open
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: 2.0.0
ruby -v: 2.0.0


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.
Posted by zzak (Zachary Scott) (Guest)
on 2013-01-10 14:07
(Received via mailing list)
Issue #7642 has been updated by zzak (Zachary Scott).


Here is another reproduction on 1.9.3-p327:
http://showterm.io/a12fb0188114e63df2e12
----------------------------------------
Bug #7642: IRB indentation is gone
https://bugs.ruby-lang.org/issues/7642#change-35319

Author: zzak (Zachary Scott)
Status: Open
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: 2.0.0
ruby -v: 2.0.0


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.
Posted by zzak (Zachary Scott) (Guest)
on 2013-01-10 14:09
(Received via mailing list)
Issue #7642 has been updated by zzak (Zachary Scott).

Status changed from Open to Assigned


----------------------------------------
Bug #7642: IRB indentation is gone
https://bugs.ruby-lang.org/issues/7642#change-35320

Author: zzak (Zachary Scott)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: 2.0.0
ruby -v: 2.0.0


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.
Posted by keiju (Keiju Ishitsuka) (Guest)
on 2013-01-10 14:56
(Received via mailing list)
Issue #7642 has been updated by keiju (Keiju Ishitsuka).


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.
----------------------------------------
Bug #7642: IRB indentation is gone
https://bugs.ruby-lang.org/issues/7642#change-35323

Author: zzak (Zachary Scott)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: 2.0.0
ruby -v: 2.0.0


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.
Posted by zzak (Zachary Scott) (Guest)
on 2013-01-10 15:08
(Received via mailing list)
Issue #7642 has been updated by zzak (Zachary Scott).


Thank you Keiju-san.

How do you enable auto-indent?
----------------------------------------
Bug #7642: IRB indentation is gone
https://bugs.ruby-lang.org/issues/7642#change-35326

Author: zzak (Zachary Scott)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: 2.0.0
ruby -v: 2.0.0


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.
Posted by keiju (Keiju Ishitsuka) (Guest)
on 2013-01-10 15:28
(Received via mailing list)
Issue #7642 has been updated by keiju (Keiju Ishitsuka).


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



----------------------------------------
Bug #7642: IRB indentation is gone
https://bugs.ruby-lang.org/issues/7642#change-35328

Author: zzak (Zachary Scott)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: 2.0.0
ruby -v: 2.0.0


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.
Posted by zzak (Zachary Scott) (Guest)
on 2013-01-10 15:55
(Received via mailing list)
Issue #7642 has been updated by zzak (Zachary Scott).


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.
----------------------------------------
Bug #7642: IRB indentation is gone
https://bugs.ruby-lang.org/issues/7642#change-35333

Author: zzak (Zachary Scott)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: 2.0.0
ruby -v: 2.0.0


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.
Posted by keiju (Keiju Ishitsuka) (Guest)
on 2013-01-11 15:18
(Received via mailing list)
Issue #7642 has been updated by keiju (Keiju Ishitsuka).

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.


----------------------------------------
Bug #7642: IRB indentation is gone
https://bugs.ruby-lang.org/issues/7642#change-35360

Author: zzak (Zachary Scott)
Status: Rejected
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: 2.0.0
ruby -v: 2.0.0


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.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.