From ae47f485fd0c0e44022cc5532bdc0b174740feea Mon Sep 17 00:00:00 2001 From: Drup Date: Tue, 18 Dec 2018 16:37:59 +0100 Subject: [PATCH] Fix lazy loading. --- src/browserMain.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/browserMain.ml b/src/browserMain.ml index a920546..f02e541 100644 --- a/src/browserMain.ml +++ b/src/browserMain.ml @@ -473,12 +473,13 @@ let filter_completion l = (* Sort the list of completions. *) let sort_completion l = let cmp - {LibIndex. file = f1; loc_impl = lazy {loc_start = l1}} - {LibIndex. file = f2; loc_impl = lazy {loc_start = l2}} = + {LibIndex. file = f1; loc_impl = l1} + {LibIndex. file = f2; loc_impl = l2} = let name_of_file (LibIndex.Cmi s | Cmt s | Cmti s) = s in let i = String.compare (name_of_file f1) (name_of_file f2) in if i <> 0 then i - else compare l1 l2 + else + compare (Lazy.force l1).loc_start (Lazy.force l2).loc_start in List.sort cmp l