diff --git a/topics/basics/architectural_overview/documents.md b/topics/basics/architectural_overview/documents.md index 288d13731..dd4f436c5 100644 --- a/topics/basics/architectural_overview/documents.md +++ b/topics/basics/architectural_overview/documents.md @@ -65,3 +65,7 @@ See also [Working with Text](working_with_text.md#safely-replacing-selected-text [`DocumentUtil`](%gh-ic%/platform/core-impl/src/com/intellij/util/DocumentUtil.java) contains utility methods for `Document` processing. This allows you to get information like the text offsets of particular lines. This is particularly useful when you need text location/offset information about a given `PsiElement`. + +## How can I mark a region as read-only? + +Use `Document.createGuardedBlock()`. diff --git a/topics/basics/faq.md b/topics/basics/faq.md index 691955710..f7e649939 100644 --- a/topics/basics/faq.md +++ b/topics/basics/faq.md @@ -36,7 +36,6 @@ for programmatic registration. * [Why doesn't the file change on disk after I changed it through the PSI?](https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791625-Action-doesn-t-see-changes-in-xml-file) * [Can I hook into the file save logic?](https://intellij-support.jetbrains.com/hc/en-us/community/posts/206790685-Can-you-tie-into-the-file-save-logic-) -* [Can I mark a part of a file as read-only?](https://intellij-support.jetbrains.com/hc/en-us/community/posts/207042355-Read-only-section-in-editor) * [How do I control what happens when the user tries to edit such a part?](https://intellij-support.jetbrains.com/hc/en-us/community/posts/206791375-Using-locked-regions) * [How can I show several editors for a single file in tabs?](https://intellij-support.jetbrains.com/hc/en-us/community/posts/206795495-Alternative-Editors-ala-HTML-Preview) * [Can I open an editor which has no underlying file on disk?](https://intellij-support.jetbrains.com/hc/en-us/community/posts/206135449-Create-an-Editor-for-a-non-physical-file)