-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set 'step' location for debugger #165
Comments
Hi Brett, you need to change this line IntFunction<Node> arrowFactory = new ArrowFactory(scriptEditor.currentParagraphProperty()); to IntFunction<Node> arrowFactory = new ArrowFactory(currentStep); That requires you to make |
Got it working so thanks for the prompt answer. For the record here are the required changes. currentStep become: The Arrow is constructed as: I had to implement an observable for Current Step as:
The full code is:
|
I've re-opened this issue as its not quite working. Whilst the triangle is now moved to the correct line it only gets re-displayed if you cause that area of the editor to re-draw. I note that my CurrentStep ObservableValue class only ever gets InvalidationListeners added. I was expecting the CodeArea to add change listeners so that when I change the line number it would force a refresh of the old/new locations of the arrow indicataor. I dug into the code of CodeArea but I really can work out what is going on. I thought looking at the code that updates the Carat position might provide some insight:
But this code really didn't really help. I've got no idea what the suspend method does. What do I need to do? |
Hi Brett, first of all, you don't need a special CurrentStep class. Just define Property<Integer> currentStep = new SimpleObjectProperty<>(0); If that doesn't solve your problem, please try to provide a simple self-contained example that I can help troubleshoot. |
Please, reopen with a SSCCE if the problem still persists. |
So I've got a little scripting language for a robotic arm and I'm trying to implement the ability to 'step' through the code.
I need to highlight the current line that the 'debug stepper' is currently on.
I've been trying to adapt code which implements a green arrow to indicate a break point.
The problem is that the code always moves the green arrow to the 'current cursor' location within a CodeArea.
I need to be able to 'select' the line using a 'next step' button.
The pertinent code is:
and the arrow function:
I've played with the 'lineNumber' changing it to use a field which contains the current 'step line' but this just results in every line getting an arrow as I step through the code.
Any assistance would be greatly appreciated.
The full class is:
The text was updated successfully, but these errors were encountered: