add spacer element to statusline (#3165)

* add spacer element to statusline

* docs
pull/3168/head^2
Seth Bromberger 2 years ago committed by GitHub
parent 742d16026e
commit bfdcfec8c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -78,6 +78,7 @@ The following elements can be configured:
| `diagnostics` | The number of warnings and/or errors |
| `selections` | The number of active selections |
| `position` | The cursor position |
| `spacer` | Inserts a space between elements (multiple/contiguous spacers may be specified) |
### `[editor.lsp]` Section

@ -143,6 +143,7 @@ where
helix_view::editor::StatusLineElement::Diagnostics => render_diagnostics,
helix_view::editor::StatusLineElement::Selections => render_selections,
helix_view::editor::StatusLineElement::Position => render_position,
helix_view::editor::StatusLineElement::Spacer => render_spacer,
}
}
@ -334,3 +335,10 @@ where
write(context, title, None);
}
fn render_spacer<F>(context: &mut RenderContext, write: F)
where
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
{
write(context, String::from(" "), None);
}

@ -246,6 +246,9 @@ pub enum StatusLineElement {
/// The cursor position
Position,
/// A single space
Spacer,
}
// Cursor shape is read and used on every rendered frame and so needs

Loading…
Cancel
Save