ruby/lib/irb/cmd/step.rb
Stan Lo 381e128c13 [ruby/irb] Fix step command (https://github.com/ruby/irb/pull/477)
The current `next` pre-command workaround on IRB source stepping
moves the location by 1 extra line. A better way is to make `debug`
skip IRB frames completely, which is what this commit does.

It also fixes the step command's test. The `|` in regexp was not escaped
so it was always incorrectly matched.
2022-12-09 23:39:17 +00:00

17 lines
255 B
Ruby

# frozen_string_literal: true
require_relative "debug"
module IRB
# :stopdoc:
module ExtendCommand
class Step < DebugCommand
def execute(*args)
super(do_cmds: ["step", *args].join(" "))
end
end
end
# :startdoc:
end