google / google/codeworld

Editable regions

Open
#1,297 0 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
Haskell
Stars
1.3k
Forks
201
PR merge metrics
No merged PRs in 30d

Description

One thing that would be extremely useful for embedded editors (see #1248) is defining regions of the source that should be considered editable, and others that should be considered fixed. This could be done in CodeMirror by adding a listener for key presses, which would check if the current selections and insertion points are all in editable regions, and set the read-only bit on the document accordingly. At the same time, the lexer could set a special style on tokens in the non-editable range, and that could be associated with a CSS style that grays out these areas, so the student sees which sections of the code are editable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.