Closed pfitzseb closed 8 years ago
What's the rationale? The only reason I can think of is protecting people from clearing the result of a long-running computation; but that's not that easy to do, and otherwise clearing a pending result seems like a consistent (if not enormously useful) thing to have.
Does this work when the clear all
command is used?
How is it not easy to clear the result of a running computation? Just press Esc
and it's gone ;)
My problem with the current behaviour is that if I had some loop that was running for some time, and accidentally (or otherwise, maybe to clear some docs) pressed Esc
, I a) wouldn't get to see my result and b) wouldn't see any possible errors and may believe that loop succeded.
The other obvious way to solve that problem is to check here whether the result still exists and if not, create another one. But since it doesn't strike me as very useful to remove a result while the computation is still running, I decided to do this.
Also, yeah, Clear all
doesn't clear results that are still loading.
Ok, I should have qualified with "accidentally" – it's not easy to press esc
accidentally, although you're right that you might try to esc something else and accidentally clear a result too (we should probably try to make that behaviour more consistent).
Anyway, I see the issue you're getting at – I have a nag that there could be a better solution but unless we think of something this patch makes a lot of sense.
On second thought, the Clear all
case may possibly be more common. I don't really care how we do it (do you think the other solution I outlined would be better/cleaner?), but I think one should always get a result back when some inline evaluation is complete, no matter what.
Fair enough – yeah, I definitely think this is cleaner as it is. We can spend some time seeing how it feels in practice as well.
I'll merge this for now -- if it turns out this behaviour isn't all that great afterall we can always revert or handle this in a better way.
and add the settings listener to our disposables.
@MikeInnes: What do you think of that change in behvaiour? While I think it's sensible to have it like this, I'm not totally sure, so I wanted to run this by you before merging.