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
This commit is contained in:
parent
45388805ad
commit
7d62fda5a3
1 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ use std::{
|
||||||
use text::Point;
|
use text::Point;
|
||||||
use ui::{prelude::*, HighlightedLabel, ListItem, ListItemSpacing};
|
use ui::{prelude::*, HighlightedLabel, ListItem, ListItemSpacing};
|
||||||
use util::{paths::PathWithPosition, post_inc, ResultExt};
|
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]);
|
actions!(file_finder, [SelectPrev]);
|
||||||
|
|
||||||
|
@ -1011,7 +1011,7 @@ impl PickerDelegate for FileFinderDelegate {
|
||||||
let finder = self.file_finder.clone();
|
let finder = self.file_finder.clone();
|
||||||
|
|
||||||
cx.spawn(|_, mut cx| async move {
|
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(row) = row {
|
||||||
if let Some(active_editor) = item.downcast::<Editor>() {
|
if let Some(active_editor) = item.downcast::<Editor>() {
|
||||||
active_editor
|
active_editor
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue