Skip to content

Commit

Permalink
fix #7654 - in a large sage worksheet "every few seconds the part of …
Browse files Browse the repository at this point in the history
…the file visible on-screen scrolls or jumps further down to a part that I'm not currently working on."
  • Loading branch information
williamstein committed Jul 7, 2024
1 parent 4055a58 commit aa1b1fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/packages/frontend/editor.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,12 @@ class CodeMirrorEditor extends FileEditor
showCursorWhenSelecting : true
extraKeys : extraKeys
cursorScrollMargin : 6
viewportMargin : 300 # larger than the default of 10 specifically so *sage worksheets* (which are the only thing that uses this)
viewportMargin : Infinity # larger than the default of 10 specifically so *sage worksheets* (which are the only thing that uses this)
# don't feel jumpy when re-rendering output.
# NOTE that in cocalc right now, no remaining non-sagews editors use this code.
# with images, even using a viewport of 300 causes major jumpiness problems with images.
# See https://github.com/sagemathinc/cocalc/issues/7654
# Browser caching may have changed in newer browsers as well making 300 feel jumpy in "modern times".

if opts.match_xml_tags
options.matchTags = {bothTags: true}
Expand Down
1 change: 1 addition & 0 deletions src/packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "rm -rf dist && NODE_OPTIONS=--max-old-space-size=8192 tsc --build && coffee -m -c -o dist/ .",
"build-coffee": "pnpm exec coffee -m -c -o dist/ .",
"tsc": "NODE_OPTIONS=--max-old-space-size=8192 ../node_modules/.bin/tsc --watch --pretty --preserveWatchOutput ",
"test": "npx jest dist/",
"prepublishOnly": "pnpm test",
Expand Down

0 comments on commit aa1b1fc

Please sign in to comment.