Skip to content

Commit 32f9a3a

Browse files
author
Stephan Dilly
committed
fix crash on small terminals (closes #307)
1 parent 2434af5 commit 32f9a3a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121

2222
### Fixed
2323
- crash when changing git repo while gitui is open ([#271](https://github.com/extrawurst/gitui/issues/271))
24+
- crash on small terminal size ([#307](https://github.com/extrawurst/gitui/issues/307))
2425

2526
## [0.10.1] - 2020-09-01
2627

Diff for: src/cmdbar.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub struct CommandBar {
3535
expanded: bool,
3636
}
3737

38-
const MORE_WIDTH: u16 = 11;
38+
const MORE_WIDTH: u16 = 9;
3939

4040
impl CommandBar {
4141
pub const fn new(
@@ -139,6 +139,10 @@ impl CommandBar {
139139
}
140140

141141
pub fn draw<B: Backend>(&self, f: &mut Frame<B>, r: Rect) {
142+
if r.width < MORE_WIDTH {
143+
return;
144+
}
145+
142146
let splitter = Text::Raw(Cow::from(strings::cmd_splitter(
143147
&self.key_config,
144148
)));

0 commit comments

Comments
 (0)