cpitclaudel / alectryon

A collection of tools for writing technical documents that mix Coq code and prose.
MIT License
228 stars 36 forks source link

Focusing on the bottom of the proof context #15

Open palmskog opened 3 years ago

palmskog commented 3 years ago

I'm a big fan of the "windowed mode", which essentially gives a display like Proof General. However, with a big proof context that doesn't fully fit on the screen, the focus is always on the top of the context, which typically only changes seldomly in most big proofs. Hence, when I step through a proof, I don't see the changes unless I manually scroll downwards in the proof context window, which is a chore.

Is there a straightforward way to make the focus in the proof context go towards the bottom of the window? I guess this would require additional JavaScript?

cpitclaudel commented 3 years ago

Is there a straightforward way to make the focus in the proof context go towards the bottom of the window? I guess this would require additional JavaScript?

Depends: if we want it only in connection with the Ctrl+arrow/click focusing feature, then we can do it with JavaScript (see the first answer at https://stackoverflow.com/questions/18614301/keep-overflow-div-scrolled-to-bottom-unless-user-scrolls-up). If we want it to work when hovering as well, then CSS is better, and we can use that ugly flexbox trick, or some more careful Javascript.

palmskog commented 3 years ago

Overall,I think it would be nice to have it both with click focusing and hovering and avoid JavaScript, so the "proper" solution may be use the flexbox trick (and maybe make bottom-focusing an explicit option that can be toggled).

However, I'm tempted to to implement the JavaScript solution separately just to see how it works, since click-focus was the main use case. If this happens, I'll post a link here.

cpitclaudel commented 3 years ago

Sounds great!

cpitclaudel commented 3 years ago

Related: #36