Skip to content

Commit aa1b1fc

Browse files
committed
fix #7654 - in a large sage worksheet "every few seconds the part of the file visible on-screen scrolls or jumps further down to a part that I'm not currently working on."
1 parent 4055a58 commit aa1b1fc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/packages/frontend/editor.coffee

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,12 @@ class CodeMirrorEditor extends FileEditor
499499
showCursorWhenSelecting : true
500500
extraKeys : extraKeys
501501
cursorScrollMargin : 6
502-
viewportMargin : 300 # larger than the default of 10 specifically so *sage worksheets* (which are the only thing that uses this)
502+
viewportMargin : Infinity # larger than the default of 10 specifically so *sage worksheets* (which are the only thing that uses this)
503503
# don't feel jumpy when re-rendering output.
504504
# NOTE that in cocalc right now, no remaining non-sagews editors use this code.
505+
# with images, even using a viewport of 300 causes major jumpiness problems with images.
506+
# See https://github.com/sagemathinc/cocalc/issues/7654
507+
# Browser caching may have changed in newer browsers as well making 300 feel jumpy in "modern times".
505508

506509
if opts.match_xml_tags
507510
options.matchTags = {bothTags: true}

src/packages/frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
"scripts": {
199199
"preinstall": "npx only-allow pnpm",
200200
"build": "rm -rf dist && NODE_OPTIONS=--max-old-space-size=8192 tsc --build && coffee -m -c -o dist/ .",
201+
"build-coffee": "pnpm exec coffee -m -c -o dist/ .",
201202
"tsc": "NODE_OPTIONS=--max-old-space-size=8192 ../node_modules/.bin/tsc --watch --pretty --preserveWatchOutput ",
202203
"test": "npx jest dist/",
203204
"prepublishOnly": "pnpm test",

0 commit comments

Comments
 (0)