From f366b5efcd8d5153e648115e4342fd7be04967a7 Mon Sep 17 00:00:00 2001 From: Nigel Date: Tue, 7 Nov 2023 20:18:02 +0000 Subject: [PATCH] Position coincident page marks in the correct order If Pg123 and Pg124 were at the same location in the file, usually because Pg123 is blank, then when the page locations are loaded from the bin file and positioned in the text widget using "marks", the mark for Pg124 was inserted at the location where Pg123's mark was, and ended up before it in the text widget's internal list of marks. Loading the marks in reverse order means that coincident marks appear in alphanumeric order, which is preferable. This was assumed to be the case by the HTML generation code when set to skip coincident pagenum spans. So this fixes #1272 --- src/lib/Guiguts/FileMenu.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Guiguts/FileMenu.pm b/src/lib/Guiguts/FileMenu.pm index b448075e..d1ceda8c 100644 --- a/src/lib/Guiguts/FileMenu.pm +++ b/src/lib/Guiguts/FileMenu.pm @@ -1283,7 +1283,7 @@ sub file_import_markup { sub interpretbinfile { my $textwindow = $::textwindow; my $markindex; - foreach my $mark ( sort keys %::pagenumbers ) { + foreach my $mark ( reverse sort keys %::pagenumbers ) { $markindex = $::pagenumbers{$mark}{offset}; unless ($markindex) { delete $::pagenumbers{$mark};