Skip to content

Commit 8d28f95

Browse files
committed
feat(statusline): integrate changes from #2676 after rebasing
1 parent 28fa36f commit 8d28f95

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

helix-term/src/ui/editor.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl EditorView {
164164
.clip_bottom(1); // -1 from bottom to remove commandline
165165

166166
let mut context =
167-
statusline::RenderContext::new(doc, view, theme, is_focused, &self.spinners);
167+
statusline::RenderContext::new(doc, view, &editor.theme, is_focused, &self.spinners);
168168

169169
StatusLine::render(editor, &mut context, statusline_area, surface);
170170
}
@@ -735,26 +735,6 @@ impl EditorView {
735735
}
736736
}
737737

738-
pub fn render_statusline(
739-
&self,
740-
editor: &Editor,
741-
doc: &Document,
742-
view: &View,
743-
viewport: Rect,
744-
surface: &mut Surface,
745-
is_focused: bool,
746-
) {
747-
let context = statusline::RenderContext {
748-
doc,
749-
view,
750-
theme: &editor.theme,
751-
focused: is_focused,
752-
spinners: &self.spinners,
753-
};
754-
755-
StatusLine::render(editor, &context, viewport, surface);
756-
}
757-
758738
/// Handle events by looking them up in `self.keymaps`. Returns None
759739
/// if event was handled (a command was executed or a subkeymap was
760740
/// activated). Only KeymapResult::{NotFound, Cancelled} is returned

helix-term/src/ui/statusline.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,15 @@ impl StatusLine {
174174
" "
175175
}
176176
),
177-
None,
177+
if visible {
178+
match context.doc.mode() {
179+
Mode::Insert => Some(context.theme.get("ui.statusline.insert")),
180+
Mode::Select => Some(context.theme.get("ui.statusline.select")),
181+
Mode::Normal => Some(context.theme.get("ui.statusline.normal")),
182+
}
183+
} else {
184+
None
185+
},
178186
);
179187
}
180188

0 commit comments

Comments
 (0)