You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.
Currently, when editing a Processing based program, I can press Ctrl+Shift+X to reevaluate the selection.
This works if I select the whole draw function for example.
But if I don't select anything, it will give an error because evaluating p.stroke(255, 0, 0) out of any context fails (p is unknown).
The SuperCollider IDE solves this by implementing a feature that autoselects the enclosing function. That would very convenient for experimentation. In my example, I can keep changing the RGB values of stroke and press Ctrl+Shift+X to observe the results.
One approach would be: if nothing is selected, start scanning from the caret position backwards until function is found, then forwards until the matching } is found (accounting for if statements and for loops), then evaluate that block leaving the caret position untouched.
The text was updated successfully, but these errors were encountered:
I would love to see that!
I'm just wondering how would it work in a case where I want to execute only one line within some brackets (In this case I dont need the internal context)
The live execution works in more use cases than Processing, so how it work for more scenarios? Maybe different shortcuts?
By the way @hamoid , what is the default shortcut for other live coding environments?
Currently, when editing a Processing based program, I can press Ctrl+Shift+X to reevaluate the selection.
This works if I select the whole
draw
function for example.But if I don't select anything, it will give an error because evaluating
p.stroke(255, 0, 0)
out of any context fails (p
is unknown).The SuperCollider IDE solves this by implementing a feature that autoselects the enclosing function. That would very convenient for experimentation. In my example, I can keep changing the RGB values of stroke and press Ctrl+Shift+X to observe the results.
One approach would be: if nothing is selected, start scanning from the caret position backwards until
function
is found, then forwards until the matching}
is found (accounting forif
statements andfor
loops), then evaluate that block leaving the caret position untouched.The text was updated successfully, but these errors were encountered: