Actions
Bug #6302
closedirb で math-mode 中でも conf.math_mode に nil を代入すると math-mode を抜ける事ができる
Description
irb では、一度 math-mode になった場合は抜ける事ができない仕様だと思いますが、conf.math_mode に nil を代入すると math-mode を抜ける事ができてしまうようです。(1.9.3-p125 で確認しましたが、trunk でも同様のようです)
conf.math_mode = true
=> true
conf.math_mode = nil
=> nil
conf.math_mode = false
=> false
conf.math_mode = true
=> true
conf.math_mode = false
IRB::CantReturnToNormalMode: Normalモードに戻れません.
from (irb):10
from /home/sho-h/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `'
false 以外でも抜ける事ができるように修正するのがよいのではないかと思いました。
--- lib/irb/ext/math-mode.rb (revision 35336)
+++ lib/irb/ext/math-mode.rb (working copy)
@@ -16,7 +16,7 @@
alias math? math_mode
def math_mode=(opt)
-
if @math_mode == true && opt == false
-
if @math_mode == true && !opt IRB.fail CantReturnToNormalMode return end
Updated by ayumin (Ayumu AIZAWA) about 13 years ago
- Category set to lib
- Assignee set to keiju (Keiju Ishitsuka)
Updated by mame (Yusuke Endoh) about 13 years ago
- Status changed from Open to Assigned
Updated by keiju (Keiju Ishitsuka) over 12 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r38621.
Sho, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- lib/irb/ext/math-mode.rb: make not able to change math-mode
after irb starting [Bug #6302]. Patched by sho-h.
Actions
Like0
Like0Like0Like0