-
Notifications
You must be signed in to change notification settings - Fork 84
Comments
Maybe a mode (like JSFiddle) where it doesn't re-parse / execute until you tell it to? |
Maybe a floating button inline that lets you "merge" the last written code so it doesn't evaluate anything before you are done typing things? |
I think a 'run when i say' mode would be a good addition, yeah. I still kinda like defaulting to instant feedback, I find I work much quicker that way. Maybe the best UX is somewhere in between the two extremes |
If we decide to disable running when the cursor is inside the loop what if you make a genuine mistake but don't move your cursor? Then you have no feedback at all and you might not know what you've done wrong immediately. Maybe we can provide a REPL specific error to provide the required feedback. |
We could also expose the currently hard-coded CodeMirror options for auto brackets and such, but won't help in the case of the for loop example. I know I'd like to have tab sizes a wee bit bigger than 2 spaces personally and auto-quoting drives me nuts :) |
@Rich-Harris , Maybe this could solve ? See 👉 JSBin/loop-protect |
That library is implemented as a Babel transform, so we wouldn't want to use it as is. But it might be an interesting idea to steal and implement as a preprocessor that walks the AST and looks for these loops. |
Ya... exactly... that is what i mean... i read the source code.. its too complex for me,, maybe we can simplify that... are you working on it now @Conduitry ?? |
Could you just prevent instant reload if the cursor is within a loop parentheses? |
#55 ( |
it's really annoying when you're in the middle of typing a for loop...
...and the code starts running before you have a chance to write
i += 1
. Similarly if you're trying to write this......you will get as far as
while (true) {
, it will add the closing}
, and you're screwed.Maybe not the easiest thing to fix, and certainly not in a general way, but I wonder if there's something that can be done to handle common cases. Like, idk, not running the code if the cursor is currently inside a loop?
The text was updated successfully, but these errors were encountered: