diff options
Diffstat (limited to 'subprojects/frontend/src/language/indentation.ts')
-rw-r--r-- | subprojects/frontend/src/language/indentation.ts | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/subprojects/frontend/src/language/indentation.ts b/subprojects/frontend/src/language/indentation.ts index 0bd2423c..b49d6563 100644 --- a/subprojects/frontend/src/language/indentation.ts +++ b/subprojects/frontend/src/language/indentation.ts | |||
@@ -38,11 +38,11 @@ function findAlignmentAfterOpening(context: TreeIndentContext): number | null { | |||
38 | * https://github.com/codemirror/language/blob/cd7f7e66fa51ddbce96cf9396b1b6127d0ca4c94/src/indent.ts#L275 | 38 | * https://github.com/codemirror/language/blob/cd7f7e66fa51ddbce96cf9396b1b6127d0ca4c94/src/indent.ts#L275 |
39 | * | 39 | * |
40 | * @example | 40 | * @example |
41 | * Result with no hanging indent (indent unit = 2 spaces, units = 1): | 41 | * Result with no hanging indent (indent unit = 4 spaces, units = 1): |
42 | * ``` | 42 | * ``` |
43 | * scope | 43 | * scope |
44 | * Family = 1, | 44 | * Family = 1, |
45 | * Person += 5..10. | 45 | * Person += 5..10. |
46 | * ``` | 46 | * ``` |
47 | * | 47 | * |
48 | * @example | 48 | * @example |
@@ -78,11 +78,8 @@ export function indentDeclaration(context: TreeIndentContext): number { | |||
78 | 78 | ||
79 | export function indentPredicateOrRule(context: TreeIndentContext): number { | 79 | export function indentPredicateOrRule(context: TreeIndentContext): number { |
80 | const clauseIndent = indentDeclarationStrategy(context, 1); | 80 | const clauseIndent = indentDeclarationStrategy(context, 1); |
81 | if (/^\s+[;.]/.exec(context.textAfter) !== null) { | 81 | if (/^\s+(?:==>|[;.])/.exec(context.textAfter) !== null) { |
82 | return clauseIndent - 2; | 82 | return clauseIndent - context.unit; |
83 | } | ||
84 | if (/^\s+(==>)/.exec(context.textAfter) !== null) { | ||
85 | return clauseIndent - 4; | ||
86 | } | 83 | } |
87 | return clauseIndent; | 84 | return clauseIndent; |
88 | } | 85 | } |