Happy Hacking
Happy Hacking

Reputation: 31

CodeMirror 2 - (readonly and editable code)

Can CodeMirror 2 be used to set part of the code to be uneditable?

I do not wish to do it like fully editable code.

Example:

Code inline: example

public static void main(String args[]){
    //content
}

I hope to be able to make Line 1 and 3 uneditable BUT able to edit lines in between them adding characters/spaces increasing the number of lines inside the method as we speak AND still unable to edit the starting and closing bracket lines.

Upvotes: 3

Views: 1215

Answers (1)

Marijn
Marijn

Reputation: 8929

No, but CodeMirror 3.1 and up can do this. See the markText method's readOnly option.

Upvotes: 3

Related Questions