Skip to content

Commit

Permalink
graphlog: don't de-indent multi-line text at end of chain
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonz committed May 11, 2022
1 parent 9f6f4b4 commit d0ecbaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/graphlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ where
self.maybe_write_pending_text()?;
}

let pad_to_index = self.edges.len();
let pad_to_index = self.edges.len() + if edges.is_empty() { 1 } else { 0 };
// Close any edges to missing nodes.
for (i, edge) in edges.iter().enumerate().rev() {
if *edge == Edge::Missing {
Expand Down Expand Up @@ -479,7 +479,7 @@ mod tests {
| o node 3
o | node 2
/ more
| text
| text
o node 1
"###);

Expand All @@ -501,8 +501,8 @@ mod tests {
| o node 2
| ~
o node 1
more
text
more
text
"###);

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion tests/test_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn test_op_log() {
@
| add workspace 'default'
o
initialize repo
initialize repo
"###);
let add_workspace_id = stdout[2..14].to_string();
let initialize_repo_id = stdout.lines().nth(2).unwrap()[2..14].to_string();
Expand Down

0 comments on commit d0ecbaf

Please sign in to comment.