summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRory Dudley2024-05-13 00:37:10 -0600
committerRory Dudley2024-05-13 00:37:10 -0600
commit1291ed9bc778e19203e748a6261cb48c9dd85e30 (patch)
tree3bf328c4bf7a66ef537bf025fe80200b78d8687c
parentce313753f555061ed8140a0664e73a3e60857d9b (diff)
downloaddwarvish-1291ed9bc778e19203e748a6261cb48c9dd85e30.tar.gz
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.
-rw-r--r--src/poem/read.rs5
1 files changed, 4 insertions, 1 deletions
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;