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({
56
56
props : [
57
57
indentNodeProp . add ( {
58
58
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 ( )
61
61
} ,
62
62
63
63
MatchBody : context => {
@@ -67,7 +67,7 @@ export const pythonLanguage = LRLanguage.define({
67
67
68
68
IfStatement : cx => / ^ \s * ( e l s e : | e l i f ) / . test ( cx . textAfter ) ? cx . baseIndent : cx . continue ( ) ,
69
69
"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 ( ) ,
71
71
MatchStatement : cx => {
72
72
if ( / ^ \s * c a s e / . test ( cx . textAfter ) ) return cx . baseIndent + cx . unit
73
73
return cx . continue ( )
You can’t perform that action at this time.
0 commit comments