From 002a3a8f6fbd74a7630e574ce665510e46e2d332 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Wed, 15 Jul 2020 01:14:55 +0200 Subject: [PATCH] fix writing out of bounds (fixes #198) --- CHANGELOG.md | 1 + src/cmdbar.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da1e8f0e..b7d8ffa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - new tags were not picked up in revlog view ([#190](https://github.com/extrawurst/gitui/issues/190)) - tags not shown in commit details popup ([#193](https://github.com/extrawurst/gitui/issues/193)) - min size for relative popups on small terminals ([#179](https://github.com/extrawurst/gitui/issues/179)) +- fix crash on resizing terminal to very small width ([#198](https://github.com/extrawurst/gitui/issues/198)) ## [0.8.1] - 2020-07-07 diff --git a/src/cmdbar.rs b/src/cmdbar.rs index 7c0a88bb..8ccfe5e0 100644 --- a/src/cmdbar.rs +++ b/src/cmdbar.rs @@ -157,7 +157,7 @@ impl CommandBar { let r = Rect::new( r.width.saturating_sub(MORE_WIDTH), r.y + r.height.saturating_sub(1), - MORE_WIDTH, + MORE_WIDTH.min(r.width), 1, );