I’ve got a marker around a section of text, and I’d like to make it impossible for the user to edit it. I can’t quite figure out how to accomplish this.
TextEditor#onWillInsertText
gives me an event with a cancel()
, but only gives me the text that will be inserted, not the range/location.
TextBuffer#onWillChange
gives me the ranges and text to be altered, but no mechanism to cancel it.
Marker
only has a onDidChange
and calling textEditor.undo()
doesn’t seem to undo the invalidation of the marker.
Any other angles I haven’t considered yet to get this working? Seems like something that the editor should have in the core – a “read-only” type marker that prevents edits at the core level…