zk icon indicating copy to clipboard operation
zk copied to clipboard

Fix zk-index--current-id-list mis-matching zk-id-regexp

Open boyechko opened this issue 3 years ago • 2 comments

This way, the function only matches zk-id-regexp at the beginning of each line rather than anywhere. While with the default zk-id-regexp it is unlikely that a file title will include something resembling the id, once customized there is a potential for a difficult to trace bug.

For example, my zk-id-regexp is much shorter, "[a-z]-[0-9]\\{4\\}", so zk-index--curent-id-list mis-matched against title containing "since mid-2000s," which introduced a nil into the ID list that then impacted sorting by size since #'< signaled an error comparing a number against nil.

boyechko avatar Sep 03 '22 06:09 boyechko

This only works if the zk-id is at the front of the string output by zk-index-format-function, which by default it is not. Have you changed zk-index-format to put the ids at the beginning of the string?

localauthor avatar Sep 03 '22 10:09 localauthor

Oh, oops, I forgot I changed that. Let me work on this a little more.

boyechko avatar Sep 04 '22 03:09 boyechko

Any progress here?

localauthor avatar Nov 07 '22 12:11 localauthor