1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-17 02:25:17 +00:00
starship/src/modules/line_break.rs

16 lines
379 B
Rust
Raw Normal View History

2019-05-01 20:34:24 +00:00
use super::{Context, Module};
2019-04-05 00:33:36 +00:00
/// Creates a segment for the line break
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
2019-04-05 00:33:36 +00:00
const LINE_ENDING: &str = "\n";
let mut module = context.new_module("line_break")?;
2019-04-12 23:11:40 +00:00
2019-05-01 20:34:24 +00:00
module.get_prefix().set_value("");
module.get_suffix().set_value("");
2019-04-13 03:06:48 +00:00
2019-05-01 20:34:24 +00:00
module.new_segment("character", LINE_ENDING);
Some(module)
2019-04-05 00:33:36 +00:00
}