aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-11-30 07:47:46 +0000
committerBlaž Hrastnik2021-11-30 07:47:46 +0000
commit3633f85b382d6f3e6324d08d880a8466aee67fa1 (patch)
tree18450c0c14e7ae25cd977daee787b6db00991570 /helix-view
parent9ed930b2335b86d03e871b52a958d4e9768e0d34 (diff)
Pass editor into render_view & gutter, reducing the number of params
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/gutter.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/helix-view/src/gutter.rs b/helix-view/src/gutter.rs
index 86773c1d..8dc243c3 100644
--- a/helix-view/src/gutter.rs
+++ b/helix-view/src/gutter.rs
@@ -1,16 +1,16 @@
use std::fmt::Write;
-use crate::{editor::Config, graphics::Style, Document, Theme, View};
+use crate::{graphics::Style, Document, Editor, Theme, View};
pub type GutterFn<'doc> = Box<dyn Fn(usize, bool, &mut String) -> Option<Style> + 'doc>;
pub type Gutter =
- for<'doc> fn(&'doc Document, &View, &Theme, &Config, bool, usize) -> GutterFn<'doc>;
+ for<'doc> fn(&'doc Editor, &'doc Document, &View, &Theme, bool, usize) -> GutterFn<'doc>;
pub fn diagnostic<'doc>(
+ _editor: &'doc Editor,
doc: &'doc Document,
_view: &View,
theme: &Theme,
- _config: &Config,
_is_focused: bool,
_width: usize,
) -> GutterFn<'doc> {
@@ -36,10 +36,10 @@ pub fn diagnostic<'doc>(
}
pub fn line_number<'doc>(
+ editor: &'doc Editor,
doc: &'doc Document,
view: &View,
theme: &Theme,
- config: &Config,
is_focused: bool,
width: usize,
) -> GutterFn<'doc> {
@@ -56,7 +56,7 @@ pub fn line_number<'doc>(
.text()
.char_to_line(doc.selection(view.id).primary().cursor(text));
- let config = config.line_number;
+ let config = editor.config.line_number;
Box::new(move |line: usize, selected: bool, out: &mut String| {
if line == last_line && !draw_last {