diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 118dafa77..a7639ab57 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -614,16 +614,22 @@ impl Picker { (size, _) if size > MAX_FILE_SIZE_FOR_PREVIEW => { CachedPreview::LargeFile } - _ => Document::open(&path, None, None, editor.config.clone()) - .map(|doc| { - // Asynchronously highlight the new document - helix_event::send_blocking( - &self.preview_highlight_handler, - path.clone(), - ); - CachedPreview::Document(Box::new(doc)) - }) - .unwrap_or(CachedPreview::NotFound), + _ => Document::open( + &path, + None, + None, + editor.config.clone(), + &editor.diff_providers, + ) + .map(|doc| { + // Asynchronously highlight the new document + helix_event::send_blocking( + &self.preview_highlight_handler, + path.clone(), + ); + CachedPreview::Document(Box::new(doc)) + }) + .unwrap_or(CachedPreview::NotFound), }, ) .unwrap_or(CachedPreview::NotFound); diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index 7437cbd07..291bb94fb 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -143,6 +143,7 @@ where helix_view::editor::StatusLineElement::FileBaseName => render_file_base_name, helix_view::editor::StatusLineElement::FileName => render_file_name, helix_view::editor::StatusLineElement::FileAbsolutePath => render_file_absolute_path, + helix_view::editor::StatusLineElement::FileRelativePath => render_file_relative_path, helix_view::editor::StatusLineElement::FileModificationIndicator => { render_file_modification_indicator } @@ -447,6 +448,27 @@ where write(context, title, None); } +fn render_file_relative_path(context: &mut RenderContext, write: F) +where + F: Fn(&mut RenderContext, String, Option