summaryrefslogtreecommitdiff
path: root/src/syntax/reparser.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-01-20 14:26:43 +0100
committerLaurenz <laurmaedje@gmail.com>2023-01-20 14:26:43 +0100
commite38839c28730ae99cd4ad357e588b5e7e840badc (patch)
treea131713fb19d132c18ce1ea7a1ea56520a50ec26 /src/syntax/reparser.rs
parentb73b4f33bcf0e4ff2cfa8438433205cd3a323e43 (diff)
Fix small newline bug
Diffstat (limited to 'src/syntax/reparser.rs')
-rw-r--r--src/syntax/reparser.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/syntax/reparser.rs b/src/syntax/reparser.rs
index 40ac2422..4c01e4cc 100644
--- a/src/syntax/reparser.rs
+++ b/src/syntax/reparser.rs
@@ -179,10 +179,10 @@ fn expand(node: &SyntaxNode) -> bool {
/// Whether `at_start` would still be true after this node given the
/// previous value of the property.
fn next_at_start(node: &SyntaxNode, at_start: &mut bool) {
- if node.kind().is_trivia() {
- if node.text().chars().any(is_newline) {
- *at_start = true;
- }
+ let kind = node.kind();
+ if kind.is_trivia() {
+ *at_start |= kind == SyntaxKind::Parbreak
+ || (kind == SyntaxKind::Space && node.text().chars().any(is_newline));
} else {
*at_start = false;
}