Coder Social home page Coder Social logo

Comments (18)

blerner avatar blerner commented on June 28, 2024 1

Super weird -- that doesn't work in Firefox! I can only reproduce what you're seeing in Chrome.

from code.pyret.org.

shriram avatar shriram commented on June 28, 2024

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.

blerner avatar blerner commented on June 28, 2024

This still falls into the "too bad" category, as CM hasn't improved on this point at all yet.

from code.pyret.org.

schanzer avatar schanzer commented on June 28, 2024

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.

schanzer avatar schanzer commented on June 28, 2024

@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.

shriram avatar shriram commented on June 28, 2024

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.

blerner avatar blerner commented on June 28, 2024

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.

sorawee avatar sorawee commented on June 28, 2024

There's https://codemirror.net/addon/scroll/scrollpastend.js, FWIW.

from code.pyret.org.

schanzer avatar schanzer commented on June 28, 2024

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.

sorawee avatar sorawee commented on June 28, 2024

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.

blerner avatar blerner commented on June 28, 2024

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.

shriram avatar shriram commented on June 28, 2024

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.

schanzer avatar schanzer commented on June 28, 2024

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.

blerner avatar blerner commented on June 28, 2024

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.

schanzer avatar schanzer commented on June 28, 2024

Try as I might, I cannot get my cursor to be at the bottom of the screen:
image

That's because of the padding-bottom: 5ex rule. I can set it to 25ex and force the REPL even higher:

image

from code.pyret.org.

jpolitz avatar jpolitz commented on June 28, 2024

@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.

brownplt/pyret-lang@03c6a84

Do we miss it dearly?

from code.pyret.org.

shriram avatar shriram commented on June 28, 2024

We miss it dearly.

from code.pyret.org.

schanzer avatar schanzer commented on June 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.