Comments (18)
Super weird -- that doesn't work in Firefox! I can only reproduce what you're seeing in Chrome.
from code.pyret.org.
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.
from code.pyret.org.
This still falls into the "too bad" category, as CM hasn't improved on this point at all yet.
from code.pyret.org.
CodePen uses CodeMirror, and it looks like they add a padding-bottom
to CodeMirror-lines when there's more than one line of code. As a result, putting the cursor at the bottom of the screen still allows you to scroll. See this example: https://codepen.io/anon/pen/XVNjJJ
from code.pyret.org.
@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 C-I
a keyboard shortcut that just adds lines?
from code.pyret.org.
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.
from code.pyret.org.
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:
- add another url parameter option,
footerStyle=resizable
, that would let the footer be draggable in height. This is easiest to implement such that students would avoid it, but teachers would forget about it, and it's kinda brittle. URL parameters really should be for embedding only. - add a "Presentation mode" to the Bonnie menu that could (a) enter fullscreen so that you get a bit more screen real-estate, (b) make the footer resizable, (c) whatever else we think is a good idea. But Bonnie menu items should be kept minimal.
- add a "Presentation theme" to the theming options that makes the footer's resizer become visible and usable.
from code.pyret.org.
There's https://codemirror.net/addon/scroll/scrollpastend.js, FWIW.
from code.pyret.org.
Whoa. @sorawee I was about to recommend doing this exact thing by hand. How did you even find this addon? It's not linked from the CM homepage!
@blerner I think this is 100% the way to go.
from code.pyret.org.
I... googled "codemirror scroll past the end" and http://codemirror.977696.n3.nabble.com/Scroll-Past-End-td4028057.html comes up.
from code.pyret.org.
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?
from code.pyret.org.
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.
from code.pyret.org.
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
from code.pyret.org.
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...
from code.pyret.org.
Try as I might, I cannot get my cursor to be at the bottom of the screen:
That's because of the padding-bottom: 5ex
rule. I can set it to 25ex
and force the REPL even higher:
from code.pyret.org.
@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?
from code.pyret.org.
We miss it dearly.
from code.pyret.org.
@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.
from code.pyret.org.
Related Issues (20)
- Add unicode ellipses (…, U+2026) to the auto-expand/replace list
- test block with no tests, and test counts HOT 1
- difference in presentation of incomparability error HOT 6
- Chart package: residuals HOT 18
- `color` does not enforce refinements HOT 3
- Should give more nudging to save a copy on shared files
- “Cancel”/“close” distinction
- Hide the import code in the publish menu
- overlay adding unecessary pixels? HOT 2
- add pi, E and e to constants context
- Pyret Blocks (tracking issue) HOT 8
- modal-prompt.js changes don't get into build HOT 3
- essentials2021 context now exports e HOT 1
- Some chart functions run out of colors (likely array index issue) HOT 6
- Can HTML entities also be replaced? HOT 2
- modes should work for categorical data HOT 7
- Choose context button blindly grabs the text after the first 11 chars HOT 1
- Don't break use-context shared-gdrive if a file is renamed HOT 5
- More Stats Functions HOT 1
- Need to make some blocks/ tests HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from code.pyret.org.