diff --git a/CHANGELOG.md b/CHANGELOG.md index c2f7b098..bd3ac806 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - crash when changing git repo while gitui is open ([#271](https://github.com/extrawurst/gitui/issues/271)) +- crash on small terminal size ([#307](https://github.com/extrawurst/gitui/issues/307)) ## [0.10.1] - 2020-09-01 diff --git a/src/cmdbar.rs b/src/cmdbar.rs index 26ae7050..64ec5879 100644 --- a/src/cmdbar.rs +++ b/src/cmdbar.rs @@ -35,7 +35,7 @@ pub struct CommandBar { expanded: bool, } -const MORE_WIDTH: u16 = 11; +const MORE_WIDTH: u16 = 9; impl CommandBar { pub const fn new( @@ -139,6 +139,10 @@ impl CommandBar { } pub fn draw(&self, f: &mut Frame, r: Rect) { + if r.width < MORE_WIDTH { + return; + } + let splitter = Text::Raw(Cow::from(strings::cmd_splitter( &self.key_config, )));