Read-only section in editor
Some of our source files are generated (by custom templates using Objecteering).
The build regularly breaks after newly generated sources are commited, beause some developer edited protected sections of those source files and these changes are lost.
Is it possible to write a plugin that creates read-only sections in the editor to prevent developers making any changes there (at least from within Idea)?
(I am afraid not, because the code generated by Idea's own GUI-Designer, also creates such sections, but those aren't shown as read-only either.)
Please sign in to leave a comment.
Stephen Friedrich wrote:
See com.intellij.openapi.editor.Document#createGuardedBlock & friends
Sascha
Document.java:287-308
Thank Sascha. I searched for "section" and "protected" to and fro, but did not think of either "block" nor "guarded" ;)
Hello, this question was asked more then 10 years ago and I am just wondering is there a way in InteliJ to create guarded blocks of code in a single file?
Thanks for the answer. But my goal is a user of IntelliJ, I would like to protect some pieces of the code, not sure how to do that.