mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Fix small newline bug
This commit is contained in:
parent
b73b4f33bc
commit
e38839c287
@ -179,10 +179,10 @@ fn expand(node: &SyntaxNode) -> bool {
|
|||||||
/// Whether `at_start` would still be true after this node given the
|
/// Whether `at_start` would still be true after this node given the
|
||||||
/// previous value of the property.
|
/// previous value of the property.
|
||||||
fn next_at_start(node: &SyntaxNode, at_start: &mut bool) {
|
fn next_at_start(node: &SyntaxNode, at_start: &mut bool) {
|
||||||
if node.kind().is_trivia() {
|
let kind = node.kind();
|
||||||
if node.text().chars().any(is_newline) {
|
if kind.is_trivia() {
|
||||||
*at_start = true;
|
*at_start |= kind == SyntaxKind::Parbreak
|
||||||
}
|
|| (kind == SyntaxKind::Space && node.text().chars().any(is_newline));
|
||||||
} else {
|
} else {
|
||||||
*at_start = false;
|
*at_start = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user