From 4b6a76bf02b544dd7cfe06de83175e17a3063c3c Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 26 Mar 2022 16:54:15 +0100 Subject: [PATCH] fix: Bookmarks not always creating new highlights correctly --- lib/libimhex/source/api/imhex_api.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libimhex/source/api/imhex_api.cpp b/lib/libimhex/source/api/imhex_api.cpp index 3a4a17c58..7b2df29fb 100644 --- a/lib/libimhex/source/api/imhex_api.cpp +++ b/lib/libimhex/source/api/imhex_api.cpp @@ -49,7 +49,9 @@ namespace hex { u32 addHighlight(const Region ®ion, color_t color, const std::string &tooltip) { auto &highlights = impl::getHighlights(); - auto id = highlights.size(); + static u64 id = 0; + + id++; highlights.insert({ id, Highlighting {region, color, tooltip}