File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ void CodeFragmentManager::Private::FragmentInfo::findBlockMarkers()
129129 }
130130 return startPos;
131131 };
132- static auto lineIndent = [](const char *&ss) -> int
132+ static auto lineIndent = [](const char *&ss, int orgCol ) -> int
133133 {
134134 int tabSize=Config_getInt (TAB_SIZE);
135135 int col = 0 ;
@@ -138,14 +138,15 @@ void CodeFragmentManager::Private::FragmentInfo::findBlockMarkers()
138138 {
139139 if (cc==' ' ) col++;
140140 else if (cc==' \t ' ) col+=tabSize-(col%tabSize);
141+ else if (cc==' \n ' ) return orgCol;
141142 else
142143 {
143144 // goto end of the line
144145 while ((cc=*ss++) && cc!=' \n ' );
145- break ;
146+ return col ;
146147 }
147148 }
148- return col ;
149+ return orgCol ;
149150 };
150151 lineNr=1 ;
151152 const char *startBuf = s;
@@ -158,9 +159,10 @@ void CodeFragmentManager::Private::FragmentInfo::findBlockMarkers()
158159
159160 const char *ss = s;
160161 int minIndent=100000 ;
162+ int indent = 0 ;
161163 while (ss<e)
162164 {
163- int indent = lineIndent (ss);
165+ indent = lineIndent (ss, indent );
164166 if (indent<minIndent)
165167 {
166168 minIndent=indent;
You can’t perform that action at this time.
0 commit comments