Skip to content

Commit

Permalink
feat(statusline): integrate changes from #2676 after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
usagi-flow committed Jul 5, 2022
1 parent 28fa36f commit 8d28f95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
22 changes: 1 addition & 21 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl EditorView {
.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);
}
Expand Down Expand Up @@ -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
/// if event was handled (a command was executed or a subkeymap was
/// activated). Only KeymapResult::{NotFound, Cancelled} is returned
Expand Down
10 changes: 9 additions & 1 deletion helix-term/src/ui/statusline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
);
}

Expand Down

0 comments on commit 8d28f95

Please sign in to comment.