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 <ecarrillo@alumni.utexas.net>
This commit is contained in:
Erik Gabriel Carrillo 2025-03-03 16:01:10 -06:00
parent 90a29ed324
commit a72ce5937c

View file

@ -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()))
}
}