on master help sign in
Remove another parameter from render_view
commit96ae5897a1c7b10a2f03e8837e8a2a6ea4c18fa4 authorBlaž Hrastnik <blaz@mxxn.io> dateWed 1 Dec 2021, 01:07 (5 years ago) parent84e939e
1 file changed+3−7
helix-term/src/ui/editor.rs+3−7
helix-term/src/ui/editor.rs+3−7
@@ -59,7 +59,6 @@ impl EditorView {
5959 &mut self.spinners
6060 }
6161
62− #[allow(clippy::too_many_arguments)]
6362 pub fn render_view(
6463 &self,
6564 editor: &Editor,
@@ -68,13 +67,13 @@ impl EditorView {
6867 viewport: Rect,
6968 surface: &mut Surface,
7069 is_focused: bool,
71− loader: &syntax::Loader,
7270 ) {
7371 let inner = view.inner_area();
7472 let area = view.area;
7573 let theme = &editor.theme;
7674
77− let highlights = Self::doc_syntax_highlights(doc, view.offset, inner.height, theme, loader);
75+ let highlights =
76+ Self::doc_syntax_highlights(doc, view.offset, inner.height, theme, &editor.syn_loader);
7877 let highlights = syntax::merge(highlights, Self::doc_diagnostics_highlights(doc, theme));
7978 let highlights: Box<dyn Iterator<Item = HighlightEvent>> = if is_focused {
8079 Box::new(syntax::merge(
@@ -117,7 +116,6 @@ impl EditorView {
117116 /// Get syntax highlights for a document in a view represented by the first line
118117 /// and column (`offset`) and the last line. This is done instead of using a view
119118 /// directly to enable rendering syntax highlighted docs anywhere (eg. picker preview)
120− #[allow(clippy::too_many_arguments)]
121119 pub fn doc_syntax_highlights<'doc>(
122120 doc: &'doc Document,
123121 offset: Position,
@@ -556,7 +554,6 @@ impl EditorView {
556554 );
557555 }
558556
559− #[allow(clippy::too_many_arguments)]
560557 pub fn render_statusline(
561558 &self,
562559 doc: &Document,
@@ -1154,8 +1151,7 @@ impl Component for EditorView {
11541151
11551152 for (view, is_focused) in cx.editor.tree.views() {
11561153 let doc = cx.editor.document(view.doc).unwrap();
1157− let loader = &cx.editor.syn_loader;
1158− self.render_view(cx.editor, doc, view, area, surface, is_focused, loader);
1154+ self.render_view(cx.editor, doc, view, area, surface, is_focused);
11591155 }
11601156
11611157 if cx.editor.config.auto_info {