From 8af1ef4f3408ef27a02d8145107e8bb282c6de85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Thu, 8 May 2025 16:06:44 +0200 Subject: [PATCH] documents.md: handle read-only behavior --- topics/basics/architectural_overview/documents.md | 3 +++ topics/basics/faq.md | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/topics/basics/architectural_overview/documents.md b/topics/basics/architectural_overview/documents.md index dd4f436c5..4333744eb 100644 --- a/topics/basics/architectural_overview/documents.md +++ b/topics/basics/architectural_overview/documents.md @@ -69,3 +69,6 @@ This is particularly useful when you need text location/offset information about ## How can I mark a region as read-only? Use `Document.createGuardedBlock()`. + +[`EditorActionManager.setReadonlyFragmentModificationHandler()`](%gh-ic%/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/EditorActionManager.java) can +be used to customize the behavior when the user attempts to modify a read-only region. diff --git a/topics/basics/faq.md b/topics/basics/faq.md index 9ce73ebb2..078ba18de 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-) -* [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) ## General