aroberge / reeborg

Enhanced Karel-the-robot clone
http://reeborg.ca/reeborg.html
Other
47 stars 36 forks source link

Fewer frames for highlighting code #357

Closed aroberge closed 7 years ago

aroberge commented 7 years ago

When executing Python code with highlighting turned on, many extra frames are created. It should be possible to keep track of lines highlighted in a different way and avoid creating extra frames when code highlighting is used.

If this is done, the use of MAX_STEPS may have to be reviewed.

This might be done by recording line highlights in a separate array, one that would include the frame number and the lines to be highlighted. Using doc.eachLine from https://codemirror.net/doc/manual.html, one could remove any existing marks and just add those required by the frame being displayed.