File tree Expand file tree Collapse file tree
src/Libraries/PythonNodeModelsWpf Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using Dynamo . UI . Controls ;
2- using ICSharpCode . AvalonEdit . Document ;
3- using ICSharpCode . AvalonEdit . Folding ;
41using System ;
52using System . Collections . Generic ;
63using System . Linq ;
7- using System . Text ;
8- using System . Windows . Media . Animation ;
4+ using ICSharpCode . AvalonEdit . Document ;
5+ using ICSharpCode . AvalonEdit . Folding ;
96
107namespace PythonNodeModelsWpf
118{
@@ -73,7 +70,7 @@ internal IEnumerable<NewFolding> CreateNewFoldingsByLine(ITextSource document)
7370 }
7471 else if ( tabLevel != currentTabLevel && currentTabLevel < tabLevel )
7572 {
76- while ( currentTabLevel < tabLevel )
73+ while ( currentTabLevel < tabLevel && startOffsets . Any ( ) )
7774 {
7875 // we close all nested tabs
7976 var tempFolding = new NewFolding ( ) ;
@@ -92,7 +89,7 @@ internal IEnumerable<NewFolding> CreateNewFoldingsByLine(ITextSource document)
9289 }
9390 else if ( whiteSpaces == 0 && tabLevel > 0 )
9491 {
95- while ( tabLevel > 0 )
92+ while ( tabLevel > 0 && startOffsets . Any ( ) )
9693 {
9794 // we close all nested tabs
9895 var tempFolding = new NewFolding ( ) ;
You can’t perform that action at this time.
0 commit comments