From 5ce96c624b1cddb30514d6bc664bb06abcee1e5f Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Fri, 20 Aug 2021 18:24:16 +0200 Subject: [PATCH] fix(desktop-entries): Display hyphen in description only if there is a description --- plugins/src/desktop_entries/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/src/desktop_entries/mod.rs b/plugins/src/desktop_entries/mod.rs index 8742270..1d1aeb0 100644 --- a/plugins/src/desktop_entries/mod.rs +++ b/plugins/src/desktop_entries/mod.rs @@ -230,10 +230,16 @@ impl App { || strsim::damerau_levenshtein(&*query, &*search_interest) < 3; if append { + let desc_source = path_string(&entry.src); + let response = PluginResponse::Append(PluginSearchResult { id: id as u32, name: entry.name.clone(), - description: format!("{} - {}", path_string(&entry.src), entry.description), + description: if entry.description.is_empty() { + desc_source.to_string() + } else { + format!("{} - {}", desc_source, entry.description) + }, keywords: entry.keywords.clone(), icon: entry.icon.clone().map(Cow::Owned).map(IconSource::Name), exec: Some(entry.exec.clone()),