org-heatmap icon indicating copy to clipboard operation
org-heatmap copied to clipboard

search-forward fails in org-heatmap-habit-add-streak

Open aspiers opened this issue 9 months ago • 1 comments

Following on from #1, I found another case where this forward search fails:

https://github.com/Elilif/org-heatmap/blob/4fe432d33a3f1caa7370e5f8d4bec2efba4827d7/org-heatmap.el#L470

It's when the agenda line is long enough to get truncated. Here's the original entry:

Image

and here's how it's rendered in the agenda:

Image

However the above code is searching for the non-truncated version (which includes the word "running" at the end, so it fails.

aspiers avatar Mar 09 '25 14:03 aspiers

This also begs the question: what if you have two different entries which look identical when truncated? Or not identical but only the last character or two are different? How could the code best be changed to reliably pick the right one?

aspiers avatar Mar 10 '25 11:03 aspiers