Skip to content

Commit

Permalink
Rename variables and replace array-list-flatten by list concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPirates committed Feb 6, 2024
1 parent 563eb1f commit 35cb8ab
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class LatexMathSymbolFoldingBuilder : FoldingBuilderEx(), DumbAware {

override fun buildFoldRegions(root: PsiElement, document: Document, quick: Boolean): Array<FoldingDescriptor> {
val descriptors = listOf<FoldingDescriptor>().toMutableList()
val mathEnvironments = root.childrenOfType(LatexMathEnvironment::class)
val mathThings = root.childrenOfType(LatexEnvironmentContent::class).filter{ it.inMathContext() }
val inlineOrDisplayMath = root.childrenOfType(LatexMathEnvironment::class)
val mathEnvironments = root.childrenOfType(LatexEnvironmentContent::class).filter { it.inMathContext() }

for (mathEnvironment in arrayOf(mathEnvironments, mathThings).toList().flatten()) {
for (mathEnvironment in inlineOrDisplayMath + mathEnvironments) {
val group = FoldingGroup.newGroup("latexMathSymbol")
val commands = mathEnvironment.childrenOfType(LatexCommands::class)

Expand Down

0 comments on commit 35cb8ab

Please sign in to comment.