Render the help message as the default no-content status message.#222
Render the help message as the default no-content status message.#222NickGeek wants to merge 8 commits intoilai-deutel:masterfrom
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #222 +/- ##
==========================================
- Coverage 42.51% 42.46% -0.05%
==========================================
Files 10 10
Lines 915 916 +1
==========================================
Hits 389 389
- Misses 526 527 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
|
Ah damn, went over the line limit thanks to clippy. I'll look into that tomorrow. |
|
Edit: fixed! |
|
Sorry for the delay, I'll review this very soon! @all-contributors please add @ NickGeek for code |
|
@all-contributors please add @NickGeek for code |
|
I've put up a pull request to add @NickGeek! 🎉 |
ilai-deutel
left a comment
There was a problem hiding this comment.
Thank you, this is a great change!
src/editor.rs
Outdated
| // Make room for the status bar and status message | ||
| (self.screen_rows, self.window_width) = (wsize.0.saturating_sub(2), wsize.1); | ||
| (self.screen_rows, self.window_width) = | ||
| (wsize.0.saturating_sub(1 + (self.status_msg().len() + wsize.1) / wsize.1), wsize.1); |
There was a problem hiding this comment.
Should it be
| (wsize.0.saturating_sub(1 + (self.status_msg().len() + wsize.1) / wsize.1), wsize.1); | |
| (wsize.0.saturating_sub(1 + (self.status_msg().len() + wsize.1 - 1) / wsize.1), wsize.1); |
instead? Currently, 1 + (self.status_msg().len() + wsize.1) / wsize.1 is equivalent to 2 + self.status_msg().len() / wsize.1
There was a problem hiding this comment.
Hmm, not quite sure how to fit this one one line with this change + keeping rustfmt happy.
There was a problem hiding this comment.
I think you need at least one extra line
- (self.screen_rows, self.window_width) =
- (wsize.0.saturating_sub(1 + (self.status_msg().len() + wsize.1 - 1) / wsize.1), wsize.1);
+ self.screen_rows =
+ wsize.0.saturating_sub(1 + (self.status_msg().len() + wsize.1 - 1) / wsize.1);
+ self.window_width = wsize.1;At least until div_ceil is stabilized :)
I just merged #229, which cuts down the total line count, so that should be fine now
Fixes #221. Also keeps the help message visible after resizing the window.