From 4d92ace27e8946273fbeaf458538f26362177d4f Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 30 Jan 2021 21:30:42 -0800 Subject: [PATCH] writer: emit multiline yaml strings Use a forked version of yaml-rust to support multiline strings. Related-to: https://github.com/chyh1990/yaml-rust/pull/137 --- Cargo.toml | 2 +- src/config/writer.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fa490b8c..68fa3104 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,5 +37,5 @@ shlex = "0.1" subprocess = "0.1" thiserror = "1.0" xdg = "2.2" -yaml-rust = "0.4" +yaml-rust = { git = "git://github.com/davvid/yaml-rust.git", branch = "multiline-strings" } yansi = "0.5" diff --git a/src/config/writer.rs b/src/config/writer.rs index 741e5b01..fbb84503 100644 --- a/src/config/writer.rs +++ b/src/config/writer.rs @@ -16,6 +16,7 @@ where let mut out_str = String::new(); { let mut emitter = YamlEmitter::new(&mut out_str); + emitter.multiline_strings(true); emitter.dump(&doc).ok(); // dump the YAML object to a String } out_str += "\n";