Closed cscheid closed 10 years ago
we are doing height calculation with every change.
In this case, the height calculation for some reason is happening at least twice, then.
One that slightly increases (1 or 2 pixels, if that much) the size of the prompt, and another that brings it back.
The end result is that it feels like the user is pounding on the keyboard and the screen is shaking.
Is it two changes per keystroke or one? I.e. does it return to the same state after each keystroke or is it alternating once per key?
It returns. The feeling is of "bouncing", one pixel up, then down.
That sounds very annoying indeed. I wonder if rounding on a half-pixel could account for this somehow.
Or, we could avoid the problem. I have always thought it would be better to calculate the line height once and cache it, rather than calculating every time. That would save one resize per iteration.
Wish we knew how to repro though.
Looked at this more closely. (Use the Source.) The prompt does not do the two-resize dance; only the cells do that. So my last comment is irrelevant.
It looks like this is really because we scroll to make sure the prompt is completely showing, after we size it. That calculation is a little too complicated.
I think this should work better (in shell_tab.js):
function scroll_to_end(duration) {
if(duration===0) {
var div = $("#rcloud-cellarea");
div.scrollTop(div[0].scrollHeight);
}
else {
window.setTimeout(function() {
ui_utils.scroll_to_after($("#prompt-div"));
}, 100);
}
}
It still does the fancy animated scroll when executing a new cell, but it just keeps fully scrolled when typing on the prompt.
If you still have access to that machine, you could edit shell_tab.js directly in the debugger to see if this replacement function fixes the problem.
Hey, this worked! I'll add the fix.
It's horrendously annoying when it happens.