summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2021-12-13 17:45:35 -0500
committerDan Davison <dandavison7@gmail.com>2021-12-13 17:45:35 -0500
commitcf270eefd9bf8dccbd08af9d25fb47d552758a36 (patch)
tree68f77ce3e25c54ae71184c377401fb56cf793dea
parent3ce64ddefb896f8a64013deb78235b4dda1d0fb8 (diff)
Bug fix: emit merge conflict markers even when width=variable
-rw-r--r--src/handlers/merge_conflict.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/handlers/merge_conflict.rs b/src/handlers/merge_conflict.rs
index d73060c9..26f9b199 100644
--- a/src/handlers/merge_conflict.rs
+++ b/src/handlers/merge_conflict.rs
@@ -212,13 +212,15 @@ fn write_merge_conflict_bar(
painter: &mut paint::Painter,
config: &config::Config,
) -> std::io::Result<()> {
- if let cli::Width::Fixed(width) = config.decorations_width {
- writeln!(
- painter.writer,
- "{}",
- &s.graphemes(true).cycle().take(width).join("")
- )?;
- }
+ let width = match config.decorations_width {
+ cli::Width::Fixed(width) => width,
+ cli::Width::Variable => config.available_terminal_width,
+ };
+ writeln!(
+ painter.writer,
+ "{}",
+ &s.graphemes(true).cycle().take(width).join("")
+ )?;
Ok(())
}