Skip to content

Commit aaa87c6

Browse files
m4rch3n1nga3lem
authored andcommitted
fix: also escape \ when pretty printing anonymous nodes (helix-editor#14819)
1 parent e657471 commit aaa87c6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

helix-core/src/syntax.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,8 +1090,8 @@ fn node_is_visible(node: &Node) -> bool {
10901090
}
10911091

10921092
fn format_anonymous_node_kind(kind: &str) -> Cow<'_, str> {
1093-
if kind.contains('"') {
1094-
Cow::Owned(kind.replace('"', "\\\""))
1093+
if kind.contains('"') || kind.contains('\\') {
1094+
Cow::Owned(kind.replace('\\', "\\\\").replace('"', "\\\""))
10951095
} else {
10961096
Cow::Borrowed(kind)
10971097
}

0 commit comments

Comments
 (0)