diff --git a/Cargo.lock b/Cargo.lock index 5d2823c..b01240f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1494,8 +1494,7 @@ dependencies = [ [[package]] name = "cosmic-text" -version = "0.18.2" -source = "git+https://github.com/pop-os/cosmic-text.git#4d74f795cc771fdcc7ea0f9cacba63fcf036fad6" +version = "0.19.0" dependencies = [ "bitflags 2.11.1", "fontdb", @@ -1513,6 +1512,7 @@ dependencies = [ "unicode-linebreak", "unicode-script", "unicode-segmentation", + "unicode-width", ] [[package]] @@ -9448,7 +9448,3 @@ dependencies = [ "syn", "winnow 0.7.15", ] - -[[patch.unused]] -name = "cosmic-text" -version = "0.19.0" diff --git a/Cargo.toml b/Cargo.toml index 18c9010..6ba4d74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -156,7 +156,7 @@ window_clipboard = { path = "/home/lionel/Devels/window_clipboard" } dnd = { path = "/home/lionel/Devels/window_clipboard/dnd" } mime = { path = "/home/lionel/Devels/window_clipboard/mime" } -[patch.'https://github.com/pop-os/cosmic-text'] +[patch.'https://github.com/pop-os/cosmic-text.git'] cosmic-text = { path = "/home/lionel/Devels/cosmic-text" } [workspace] diff --git a/src/clipboard.rs b/src/clipboard.rs index 5892071..89da7d7 100644 --- a/src/clipboard.rs +++ b/src/clipboard.rs @@ -132,9 +132,10 @@ impl TryFrom<(Vec, String)> for ClipboardPaste { match mime.as_str() { "text/uri-list" => { let text = str::from_utf8(&data)?; - let lines = text.lines(); - - for line in text.lines() { + for line in text.lines().filter(|line| { + let line = line.trim(); + !line.is_empty() && !line.starts_with('#') + }) { let url = Url::parse(line)?; match url.to_file_path() { Ok(path) => paths.push(path), diff --git a/src/trash.rs b/src/trash.rs index ce37c83..cc39d02 100644 --- a/src/trash.rs +++ b/src/trash.rs @@ -27,7 +27,7 @@ pub trait TrashExt { Vec::new() } - fn scan_search bool + Sync>(callback: F, regex: &Regex) {} + fn scan_search bool + Sync>(callback: F, regex: &Regex); fn icon(icon_size: u16) -> widget::icon::Handle { widget::icon::from_name(if Self::is_empty() { @@ -142,4 +142,12 @@ impl TrashExt for Trash { not(target_os = "android") ) )))] -impl TrashExt for Trash {} +impl TrashExt for Trash { + fn scan_search bool + Sync>(callback: F, regex: &Regex) { + log::warn!( + "searching trash not supported on this platform for pattern {:?}", + regex.as_str() + ); + drop(callback); + } +}