From a72ce5937c1b9ebf530f3a12c9cb91f6d5082b39 Mon Sep 17 00:00:00 2001 From: Erik Gabriel Carrillo Date: Mon, 3 Mar 2025 16:01:10 -0600 Subject: [PATCH] Allow cheatsheet items with same descriptions Prior to the refactor performed in https://github.com/denisidoro/navi/pull/760, cheatsheet items could have the same tags and the same description, but a different snippet, and they would all be listed in the finder. After the refactor, this behavior has changed and such items will now be treated as non-unique. There appears to be no requirement for item descriptions to be distinct, so this patch restores the earlier behavior. Fixes: https://github.com/denisidoro/navi/issues/951 Signed-off-by: Erik Gabriel Carrillo --- src/structures/item.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/item.rs b/src/structures/item.rs index da4a181..f5eae53 100644 --- a/src/structures/item.rs +++ b/src/structures/item.rs @@ -18,6 +18,6 @@ impl Item { } pub fn hash(&self) -> u64 { - fnv(&format!("{}{}", &self.tags.trim(), &self.comment.trim())) + fnv(&format!("{}{}{}", &self.tags.trim(), &self.comment.trim(), &self.snippet.trim())) } }