mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
KTNB, DS: Turn off folding for injected code in Kotlin Notebooks
GitOrigin-RevId: bde88dafffe1d26ac8358413452f1508b8512499
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9a764784ea
commit
2bc48a119f
@@ -44,6 +44,8 @@ public final class FoldingUpdate {
|
||||
|
||||
private static final Key<CachedValue<Runnable>> CODE_FOLDING_KEY = Key.create("code folding");
|
||||
|
||||
public static final Key<Boolean> INJECTED_CODE_FOLDING_ENABLED = Key.create("injected code folding is enabled");
|
||||
|
||||
private FoldingUpdate() {
|
||||
}
|
||||
|
||||
@@ -130,6 +132,10 @@ public final class FoldingUpdate {
|
||||
@Nullable
|
||||
public static Runnable updateInjectedFoldRegions(@NotNull final Editor editor, @NotNull final PsiFile file, final boolean applyDefaultState) {
|
||||
if (file instanceof PsiCompiledElement) return null;
|
||||
final Boolean codeFoldingEnabled = editor.getUserData(INJECTED_CODE_FOLDING_ENABLED);
|
||||
if (codeFoldingEnabled != null && !codeFoldingEnabled) {
|
||||
return null;
|
||||
}
|
||||
ApplicationManager.getApplication().assertReadAccessAllowed();
|
||||
|
||||
final Project project = file.getProject();
|
||||
|
||||
Reference in New Issue
Block a user