Last active
December 22, 2015 04:48
-
-
Save jage/6419261 to your computer and use it in GitHub Desktop.
Show which line is executing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Please convert this to a Sublime Text 3 plugin. | |
require 'curses' | |
Curses.init_screen | |
SOURCE_LINES = File.read(__FILE__).split("\n") | |
TracePoint.trace(:line) do |tp| | |
Curses.clear | |
SOURCE_LINES.each_with_index do |src,row| | |
Curses.setpos(row, 0) | |
Curses.addstr(src) | |
end | |
Curses.setpos(tp.lineno-1, 0) | |
Curses.refresh | |
end | |
loop do | |
sleep 0.5 | |
sleep 0.5 | |
sleep 0.5 | |
end | |
Curses.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment