-
Notifications
You must be signed in to change notification settings - Fork 44
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
writing code off the bottom of the screen #336
Comments
This is still a problem, and maybe there's something in CodeMirror that helps now? I still find myself (both when coding on my own, and in class) having to insert a whole bunch of newlines. |
This still falls into the "too bad" category, as CM hasn't improved on this point at all yet. |
CodePen uses CodeMirror, and it looks like they add a |
@shriram now that we have a footer, the cursor no longer goes to the bottom of the screen. Is this good enough, or would the suggestion be to make |
I don't feel this problem has really improved. If you're teaching in a room where the bottom 20% of the screen is not visible from everywhere (as often happens), you really want to move the active area to the middle of the screen. |
I sympathize, and am also really, really struggling to think how to implement this within the confines of CSS. Emacs' notion of Ctrl+I is really weird, from an implementation perspective, and AFAIK CodeMirror simply doesn't let you scroll past the bottom of the document. (I.e., the invariant seems to be "if there's any vertical space at the bottom of the screen that doesn't correspond to a line of text of the document, then the zeroth line of the document must be visible." I've checked their scrolling APIs and you can't scroll to a line past the end of the document.) One idea I just had was to allow the bottom footer to have resizable height, just as the separator bar resizes the width of definitions and interactions. The idea would be that if you could resize it big enough, then even if the REPL is at the "bottom" of its area, that bottom is still visible to everyone. I don't want this resizing to be available by default, though, since it'd confuse students... Three possibilities:
|
There's https://codemirror.net/addon/scroll/scrollpastend.js, FWIW. |
I... googled "codemirror scroll past the end" and http://codemirror.977696.n3.nabble.com/Scroll-Past-End-td4028057.html comes up. |
Ok, so to be clear, this is not a 100% fix. What it allows you to do is instantly add a scrollbar to the definitions area, so that you can scroll until the last line of the file is at the top of the screen (which breaks the putative invariant I claimed above, so go figgur). It's a bit ugly, to be honest, since the scrollbar is unneeded almost all the time...but it's a workaround. But it does nothing to fix the REPL side of the screen, which still has a similar problem: the last line of text will be at the bottom of the screen. And I think Shriram has complained bitterly about that being a problem as well...right? |
Well, I'll take what I can get…but yes, this is also a problem in the REPL. I have sometimes re-run programs just to get the cursor back up. |
The interactions area has been fixed for quite some time. There’s a 5em bottom padding that was added specifically to fix this problem. If that’s not big enough, we can talk about changing that number |
I don't see any such thing...? If I have a bunch of interactions such that the interactions area needs a scrollbar, I get no padding below the last item at all... |
Super weird -- that doesn't work in Firefox! I can only reproduce what you're seeing in Chrome. |
@shriram re the repl option: amusingly, way back there was a “Clear” button that did basically Ctrl-L. I can't find the discussion about it, but it was argued that it should be removed. Do we miss it dearly? |
We miss it dearly. |
@blerner See https://stackoverflow.com/questions/29986977/firefox-ignores-padding-when-using-overflowscroll We should make sure this works on FF, even when we bring back the kbd shortcut for Shriram. It solves a large percentage of "simple cases" in normal k12 classrooms, where what's needed is just an extra 6-12" at the bottom of the projector. |
…l last row of content is scrollable to top of screen. Does not address the Firefox REPL padding issue yet.
No matter how tall your monitor, once your program gets long, you're stuck writing at the very bottom of your screen. There doesn't seem to be an equivalent of C-l in Emacs to re-center things. Maybe this is fine by kids these days, but I find myself adding a bunch of blank lines to the file...
In case there's an option to do something about this in CodeMirror, it'd be nice to enable it. And if not, perhaps file a not-expecting-to-be-fixed-soon request.
The text was updated successfully, but these errors were encountered: