File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,8 @@ export const pythonLanguage = LRLanguage.define({
5656 props : [
5757 indentNodeProp . add ( {
5858 Body : context => {
59- let inner = innerBody ( context )
60- return indentBody ( context , inner || context . node ) ?? context . continue ( )
59+ let body = / ^ \s * ( # | $ ) / . test ( context . textAfter ) && innerBody ( context ) || context . node
60+ return indentBody ( context , body ) ?? context . continue ( )
6161 } ,
6262
6363 MatchBody : context => {
@@ -67,7 +67,7 @@ export const pythonLanguage = LRLanguage.define({
6767
6868 IfStatement : cx => / ^ \s * ( e l s e : | e l i f ) / . test ( cx . textAfter ) ? cx . baseIndent : cx . continue ( ) ,
6969 "ForStatement WhileStatement" : cx => / ^ \s * e l s e : / . test ( cx . textAfter ) ? cx . baseIndent : cx . continue ( ) ,
70- TryStatement : cx => / ^ \s * ( e x c e p t | f i n a l l y : | e l s e : ) / . test ( cx . textAfter ) ? cx . baseIndent : cx . continue ( ) ,
70+ TryStatement : cx => / ^ \s * ( e x c e p t [ : ] | f i n a l l y : | e l s e : ) / . test ( cx . textAfter ) ? cx . baseIndent : cx . continue ( ) ,
7171 MatchStatement : cx => {
7272 if ( / ^ \s * c a s e / . test ( cx . textAfter ) ) return cx . baseIndent + cx . unit
7373 return cx . continue ( )
You can’t perform that action at this time.
0 commit comments