From 08d0e2cfafc061ea7f57311a4c25b2adc7cf6d3d Mon Sep 17 00:00:00 2001 From: Abby Berkers Date: Wed, 11 Oct 2023 21:32:03 +0200 Subject: [PATCH] Add structure view elements to correct level (fixes #3273) --- .../texifyidea/structure/latex/LatexStructureViewElement.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nl/hannahsten/texifyidea/structure/latex/LatexStructureViewElement.kt b/src/nl/hannahsten/texifyidea/structure/latex/LatexStructureViewElement.kt index ae528ccdc..f60a5a4a8 100644 --- a/src/nl/hannahsten/texifyidea/structure/latex/LatexStructureViewElement.kt +++ b/src/nl/hannahsten/texifyidea/structure/latex/LatexStructureViewElement.kt @@ -195,7 +195,7 @@ class LatexStructureViewElement(private val element: PsiElement) : StructureView } // Avoid that an element is not added at all by adding it one level up anyway. // If index is null, that means that the tree currently only has elements with a higher order. - else { + else if (index == null || indexInsert == index) { registerSameLevel(sections, child, currentCmd, treeElements, numbering) break }