Skip to content

Instantly share code, notes, and snippets.

@jage
Last active December 22, 2015 04:48
Show Gist options
  • Save jage/6419261 to your computer and use it in GitHub Desktop.
Save jage/6419261 to your computer and use it in GitHub Desktop.
Show which line is executing
# 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