8000 Properly determine a base indentation when indenting a block · codemirror/lang-python@b9203ee · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit b9203ee

Browse files
committed
Properly determine a base indentation when indenting a block
FIX: Fix a bug where blocks started after a wrapped argument list or similar construct were indented too far. Closes codemirror/dev#1182
1 parent 73a4909 commit b9203ee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"license": "MIT",
2828
"dependencies": {
2929
"@codemirror/autocomplete": "^6.3.2",
30-
"@codemirror/language": "^6.0.0",
30+
"@codemirror/language": "^6.8.0",
3131
"@lezer/python": "^1.1.4"
3232
},
3333
"devDependencies": {

src/python.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {globalCompletion, localCompletionSource} from "./complete"
66
export {globalCompletion, localCompletionSource}
77

88
function indentBody(context: TreeIndentContext, node: SyntaxNode) {
9-
let base = context.lineIndent(node.from)
9+
let base = context.baseIndentFor(node)
1010
let line = context.lineAt(context.pos, -1), to = line.from + line.text.length
1111
// Don't consider blank, deindented lines at the end of the
1212
// block part of the block

0 commit comments

Comments
 (0)
0