feat(statusline): integrate changes from #2676 after rebasing

pull/2434/head
etienne-k 2 years ago
parent 28fa36f46f
commit 8d28f9543c
No known key found for this signature in database
GPG Key ID: BFCB7E748E5F8A50

@ -164,7 +164,7 @@ impl EditorView {
.clip_bottom(1); // -1 from bottom to remove commandline .clip_bottom(1); // -1 from bottom to remove commandline
let mut context = let mut context =
statusline::RenderContext::new(doc, view, theme, is_focused, &self.spinners); statusline::RenderContext::new(doc, view, &editor.theme, is_focused, &self.spinners);
StatusLine::render(editor, &mut context, statusline_area, surface); StatusLine::render(editor, &mut context, statusline_area, surface);
} }
@ -735,26 +735,6 @@ impl EditorView {
} }
} }
pub fn render_statusline(
&self,
editor: &Editor,
doc: &Document,
view: &View,
viewport: Rect,
surface: &mut Surface,
is_focused: bool,
) {
let context = statusline::RenderContext {
doc,
view,
theme: &editor.theme,
focused: is_focused,
spinners: &self.spinners,
};
StatusLine::render(editor, &context, viewport, surface);
}
/// Handle events by looking them up in `self.keymaps`. Returns None /// Handle events by looking them up in `self.keymaps`. Returns None
/// if event was handled (a command was executed or a subkeymap was /// if event was handled (a command was executed or a subkeymap was
/// activated). Only KeymapResult::{NotFound, Cancelled} is returned /// activated). Only KeymapResult::{NotFound, Cancelled} is returned

@ -174,7 +174,15 @@ impl StatusLine {
" " " "
} }
), ),
None, if visible {
match context.doc.mode() {
Mode::Insert => Some(context.theme.get("ui.statusline.insert")),
Mode::Select => Some(context.theme.get("ui.statusline.select")),
Mode::Normal => Some(context.theme.get("ui.statusline.normal")),
}
} else {
None
},
); );
} }

Loading…
Cancel
Save