diff --git a/CHANGELOG.md b/CHANGELOG.md index d64f2cc3..2b1b6d74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +**commit subject length warning** + +![warning](assets/commit-msg-length-limit.gif) + +## Added +- warning if commit subject line gets too long ([#478](https://github.com/extrawurst/gitui/issues/478)) + ## [0.15.0] - 2020-04-27 **file blame** diff --git a/assets/commit-msg-length-limit.gif b/assets/commit-msg-length-limit.gif new file mode 100644 index 00000000..ea7e1687 Binary files /dev/null and b/assets/commit-msg-length-limit.gif differ diff --git a/src/components/commit.rs b/src/components/commit.rs index 1d1e9e16..c7b7efea 100644 --- a/src/components/commit.rs +++ b/src/components/commit.rs @@ -207,7 +207,7 @@ impl CommitComponent { .get_text() .lines() .next() - .map(|line| line.len()) + .map(str::len) .unwrap_or_default(); if first_line > FIRST_LINE_LIMIT { @@ -218,12 +218,12 @@ impl CommitComponent { let rect = { let mut rect = self.input.get_area(); - rect.y = rect.y + rect.height.saturating_sub(1); + rect.y += rect.height.saturating_sub(1); rect.height = 1; let offset = rect.width.saturating_sub(msg_length + 1); rect.width = rect.width.saturating_sub(offset + 1); - rect.x = rect.x + offset; + rect.x += offset; rect };