We have an API which exposes functions. We’d like to have the function signature and opening/closing { } to not be editable. Something like this:
int Add(int a, int b)
{
// user editable code goes here, but not before or after
}
Option 1: We put the opening and closing lines above and below the editor DIV where CodeMirror runs, and indent the div slightly. This would definitely give the effect we want, but on its own it’s invalid C code as it has no opening/closing braces, and the function parameters aren’t visible. Is there some way to inject the lines before/after?
Option 2: We don’t let the cursor/caret move to line 1 or 2, or last line. This should work, but it seems like it would be visually confusing and maybe take too many cycles?
Option 3?
Thanks,
Brett