fix crash on small terminals (closes #307)

This commit is contained in:
Stephan Dilly 2020-10-05 21:10:37 +02:00
parent 2434af55bd
commit 32f9a3a4df
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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<B: Backend>(&self, f: &mut Frame<B>, r: Rect) {
if r.width < MORE_WIDTH {
return;
}
let splitter = Text::Raw(Cow::from(strings::cmd_splitter(
&self.key_config,
)));