I set readonly lines in my editor this way:
editor.on('beforeChange', function(cm, change) {
if (~readOnlyLines.indexOf(change.from.line)) {
change.cancel();
}
}
Where readOnlyLines is an array containing numbers of the lines to be readonly.
The problem is that when I am on an editable row with a readonly one below, if I press "Del" the readonly row comes upside and I can edit it.
The same doesn't work if I have a readonly row above and I press "BackSpace".
I think I should add an if that checks if at the same time:
- Del is pressed (I used a catch event)
- The line below is readonly (I did it the same way I did with the if in the code above)
- The cursor is at the end of line (Does a specific function exist?)