From 1291ed9bc778e19203e748a6261cb48c9dd85e30 Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Mon, 13 May 2024 00:37:10 -0600 Subject: Fix another another regression with aliases For aliases, only set couplet for the last verse, if the original verse has its couplet set. Otherwise, the alias could have trouble with piping. --- src/poem/read.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/poem/read.rs') diff --git a/src/poem/read.rs b/src/poem/read.rs index e5cd25d..2b0dd60 100644 --- a/src/poem/read.rs +++ b/src/poem/read.rs @@ -79,6 +79,7 @@ impl Appendable for Poem { Some(alias) => { // Interpret the alias (could be a complex poem) let mut poem = Poem::read(alias.to_string(), env)?; + println!("{:?}", poem); // Try and get the last verse let lv = match poem.last_mut() { @@ -87,7 +88,9 @@ impl Appendable for Poem { }; // The last verse inherits the traits from the original - lv.couplet = verse.couplet; + if verse.couplet { + lv.couplet = verse.couplet; + } lv.io = verse.io; lv.poems = verse.poems.clone(); lv.meter = verse.meter; -- cgit v1.2.3