10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f8d660 commit 1fe52eaCopy full SHA for 1fe52ea
src/python.ts
@@ -7,6 +7,14 @@ export {globalCompletion, localCompletionSource}
7
8
function indentBody(context: TreeIndentContext, node: SyntaxNode) {
9
let base = context.lineIndent(node.from)
10
+ let line = context.lineAt(context.pos, -1), to = line.from + line.text.length
11
+ // Don't consider blank, deindented lines at the end of the
12
+ // block part of the block
13
+ if (/^\s*($|#)/.test(line.text) &&
14
+ context.node.to < to + 100 &&
15
+ !/\S/.test(context.state.sliceDoc(to, context.node.to)) &&
16
+ context.lineIndent(context.pos, -1) <= base)
17
+ return null
18
// A normally deindenting keyword that appears at a higher
19
// indentation than the block should probably be handled by the next
20
// level
0 commit comments