From 7d62fda5a38d1199e79c30177828dfac2a1ce4b3 Mon Sep 17 00:00:00 2001 From: CharlesChen0823 Date: Sat, 21 Sep 2024 03:49:40 +0800 Subject: [PATCH] file_finder: Notify user when picker an non-utf8 file (#18136) notify user when using file finder picker an file which cannot open. Release Notes: - N/A --- crates/file_finder/src/file_finder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/file_finder/src/file_finder.rs b/crates/file_finder/src/file_finder.rs index e1e0998f8a..4c3f92d3c1 100644 --- a/crates/file_finder/src/file_finder.rs +++ b/crates/file_finder/src/file_finder.rs @@ -31,7 +31,7 @@ use std::{ use text::Point; use ui::{prelude::*, HighlightedLabel, ListItem, ListItemSpacing}; use util::{paths::PathWithPosition, post_inc, ResultExt}; -use workspace::{item::PreviewTabsSettings, ModalView, Workspace}; +use workspace::{item::PreviewTabsSettings, notifications::NotifyResultExt, ModalView, Workspace}; actions!(file_finder, [SelectPrev]); @@ -1011,7 +1011,7 @@ impl PickerDelegate for FileFinderDelegate { let finder = self.file_finder.clone(); cx.spawn(|_, mut cx| async move { - let item = open_task.await.log_err()?; + let item = open_task.await.notify_async_err(&mut cx)?; if let Some(row) = row { if let Some(active_editor) = item.downcast::() { active_editor