Re: Editing RubyEdit class
Posted: Thu Aug 21, 2014 9:32 pm
trogluddite wrote:Exo wrote:To work we would need to copy the original code as a new string object and append the number to the beginning of each line manually and then this could be displayed.
Yes, and there is a sneaky way to do it.
Systems are down at home at the moment for some home improvements, but I have it working and can post later.
The trick is to hijack a RubyEdit method called "parse" - it gets called every time the code is edited. IIRC, I intercepted the input arguments by doing something like this...
- Code: Select all
def parse(*args, &block)
@code_string = args[0] # May not be the right index!
super(*args, &block) # Hand control back to the original method
end
@Exo - take a look in the code tracer prototype I sent you. it is in there somewhere.
Thanks Trog will take a look