diff --git a/src/commit/types/scope.rs b/src/commit/types/scope.rs index 2ad88f4..6510317 100644 --- a/src/commit/types/scope.rs +++ b/src/commit/types/scope.rs @@ -61,7 +61,11 @@ impl Scope { /// Returns the visible length of the header segment pub fn header_segment_len(&self) -> usize { - self.header_segment().chars().count() + if self.is_empty() { + 0 + } else { + self.0.chars().count() + 2 + } } }