@@ -421,19 +421,19 @@ impl EditorView {
421 .map(|range| range.cursor_line(text))
421 .map(|range| range.cursor_line(text))
422 .collect();
422 .collect();
424− fn diagnostic(
424+ fn diagnostic<'doc>(
425− doc: &Document,
425+ doc: &'doc Document,
426 _view: &View,
426 _view: &View,
427 theme: &Theme,
427 theme: &Theme,
428 _config: &Config,
428 _config: &Config,
429 _is_focused: bool,
429 _is_focused: bool,
430 _width: usize,
430 _width: usize,
431− ) -> GutterFn {
431+ ) -> GutterFn<'doc> {
432 let warning = theme.get("warning");
432 let warning = theme.get("warning");
433 let error = theme.get("error");
433 let error = theme.get("error");
434 let info = theme.get("info");
434 let info = theme.get("info");
435 let hint = theme.get("hint");
435 let hint = theme.get("hint");
436− let diagnostics = doc.diagnostics().to_vec(); // TODO
436+ let diagnostics = doc.diagnostics();
438 Box::new(move |line: usize, _selected: bool| {
438 Box::new(move |line: usize, _selected: bool| {
439 use helix_core::diagnostic::Severity;
439 use helix_core::diagnostic::Severity;
@@ -452,14 +452,14 @@ impl EditorView {
455− fn line_number(
455+ fn line_number<'doc>(
456− doc: &Document,
456+ doc: &'doc Document,
457 view: &View,
457 view: &View,
458 theme: &Theme,
458 theme: &Theme,
459 config: &Config,
459 config: &Config,
460 is_focused: bool,
460 is_focused: bool,
461 width: usize,
461 width: usize,
462− ) -> GutterFn {
462+ ) -> GutterFn<'doc> {
463 let text = doc.text().slice(..);
463 let text = doc.text().slice(..);
464 let last_line = view.last_line(doc);
464 let last_line = view.last_line(doc);
465 // Whether to draw the line number for the last line of the
465 // Whether to draw the line number for the last line of the
@@ -499,8 +499,9 @@ impl EditorView {
502− type GutterFn = Box<dyn Fn(usize, bool) -> Option<(String, Style)>>;
502+ type GutterFn<'doc> = Box<dyn Fn(usize, bool) -> Option<(String, Style)> + 'doc>;
503− type Gutter = fn(&Document, &View, &Theme, &Config, bool, usize) -> GutterFn;
504+ for<'doc> fn(&'doc Document, &View, &Theme, &Config, bool, usize) -> GutterFn<'doc>;
504 let gutters: &[(Gutter, usize)] = &[(diagnostic, 1), (line_number, 5)];
505 let gutters: &[(Gutter, usize)] = &[(diagnostic, 1), (line_number, 5)];
506 let mut offset = 0;
507 let mut offset = 0;