Project

General

Profile

Actions

Bug #6302

closed

irb で math-mode 中でも conf.math_mode に nil を代入すると math-mode を抜ける事ができる

Added by sho-h (Sho Hashimoto) about 12 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
Backport:
[ruby-dev:45518]

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 12 years ago

  • Category set to lib
  • Assignee set to keiju (Keiju Ishitsuka)

Updated by mame (Yusuke Endoh) about 12 years ago

  • Status changed from Open to Assigned
Actions #3

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

Also available in: Atom PDF

Like0
Like0Like0Like0