Closed ghost closed 14 years ago
thought of a solution (won't work with auto-indentation but worth it): instead of having a method to find the nesting level change, in run_script run the line (with previous lines) and check for an 'unexpected $end' error - if there was one, you know that the user needs to finish the statement. It will be like IRB.
This is odd, this bug doesn't occur in my version of tryruby, which is nearly the same as sophrinix's version. I thought this problem was a regression with the changes you have made. The current version uses a regexp like /^\s*end\s*$/
would match end
but not "agenda"
I think the best plan would be to eventually replace the current code with using a persistent irb process, since atm every line of code sent to the server has to be run multiple times (which can't be very efficient CPU wise). This way we wouldn't have to lose auto indentation either.
I fixed the 'agenda' bug, but it will still match the end if it has spaces. You shouldn't use ^\send\s$ because you couldn't type "end.reverse" or "def asd; 'asd'; end". My version uses \b(end|})\b
you (whoever can figure out how to close this) should probably close it now, nanothief fixed it.
Is the fix in orangea's repo, or just nanothief's?
it is in mine.
closing
... it didn't close. trying again.
unclosable!
closed
now
For the auto-indentation feature, the nesting level will go down if you have things like "agenda".