Skip to content

Commit

Permalink
feat: ephemeral-messages option
Browse files Browse the repository at this point in the history
  • Loading branch information
Axlefublr committed Oct 14, 2024
1 parent 702d4dd commit 7b334cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ This exists because in default helix, even if you have no statusline elements in
This option is designed to be disabled in your config, but you can set it on runtime as well (surprisingly). \
It will look wonky if you do, so it makes the most sense to make a hotkey to toggle the statusline when / if you suddenly realize you want to see information in it (while not caring about it in the general case).

`ephemeral-messages` option in the `[editor]` section can now be set to `true` to make status / error messages at the bottom of the UI *not* take up an entire line. Instead, they will be printed over the editor view directly.

### Implemented PRs from upstream

* [11234](https://github.com/helix-editor/helix/issues/11234) by @Swordelf2
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ impl Component for EditorView {
};

// -1 for commandline and -1 for bufferline
let mut editor_area = area.clip_bottom(1);
let mut editor_area = area.clip_bottom(if config.ephemeral_messages { 0 } else { 1 });
if use_bufferline {
editor_area = editor_area.clip_top(1);
}
Expand Down
5 changes: 4 additions & 1 deletion helix-view/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,10 @@ pub struct Config {
//--------------------------------------------------fork--------------------------------------------------
/// Whether to display infoboxes for mappings. If `auto_info` is true, and `whichkey` is false, you will only get infoboxes for `register_select`. Defaults to true.
pub whichkey: bool,
/// Whether to display the statusline at all.
/// Whether to display the statusline at all. Defaults to true.
pub should_statusline: bool,
/// Whether to make messages take up an entire line in the UI, or appear over editor text. Defaults to the latter (false).
pub ephemeral_messages: bool,
//--------------------------------------------------fork--------------------------------------------------
/// Padding to keep between the edge of the screen and the cursor when scrolling. Defaults to 5.
pub scrolloff: usize,
Expand Down Expand Up @@ -984,6 +986,7 @@ impl Default for Config {
//----------------------------------------------fork----------------------------------------------
should_statusline: true,
whichkey: true,
ephemeral_messages: false,
//----------------------------------------------fork----------------------------------------------
scrolloff: 5,
scroll_lines: 3,
Expand Down

0 comments on commit 7b334cc

Please sign in to comment.