feat(statusline): integrate changes from #2676 after rebasing
This commit is contained in:
parent
28fa36f46f
commit
8d28f9543c
@ -164,7 +164,7 @@ pub fn render_view(
|
||||
.clip_bottom(1); // -1 from bottom to remove commandline
|
||||
|
||||
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);
|
||||
}
|
||||
@ -735,26 +735,6 @@ pub fn highlight_cursorline(doc: &Document, view: &View, surface: &mut Surface,
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
/// if event was handled (a command was executed or a subkeymap was
|
||||
/// activated). Only KeymapResult::{NotFound, Cancelled} is returned
|
||||
|
@ -174,7 +174,15 @@ fn render_mode<F>(context: &mut RenderContext, write: F)
|
||||
" "
|
||||
}
|
||||
),
|
||||
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…
Reference in New Issue
Block a user