From ffe3ef6863f8e9074886c34ebcaf8b9e40907451 Mon Sep 17 00:00:00 2001 From: Rob Knop Date: Mon, 22 Jul 2019 15:28:38 -0400 Subject: [PATCH] Fix nextcurlevel bug detecting first entry; clean up indentation a bit. --- listview.ml | 2 +- main.ml | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/listview.ml b/listview.ml index 000c52a..e660cb9 100644 --- a/listview.ml +++ b/listview.ml @@ -397,7 +397,7 @@ object (self) else -1 in let rec flow i = - if i = len then i-1 else if i = 1 then 0 else + if i = len then i-1 else if i = -1 then 0 else let _, l = source#getitem i in if l <= curlevel then i else flow (i+incr) in diff --git a/main.ml b/main.ml index 60ff83e..033436a 100644 --- a/main.ml +++ b/main.ml @@ -1942,7 +1942,10 @@ class outlinelistview ~zebra ~source = postRedisplay "outline ctrl right"; {< m_pan = m_pan + 1 >} ) - else if Wsi.withshift mask then self#nextcurlevel 1 + else if Wsi.withshift mask + then ( + self#nextcurlevel 1 + ) else self#updownlevel 1 in coe o @@ -1954,7 +1957,10 @@ class outlinelistview ~zebra ~source = postRedisplay "outline ctrl left"; {< m_pan = m_pan - 1 >} ) - else if Wsi.withshift mask then self#nextcurlevel ~-1 + else if Wsi.withshift mask + then ( + self#nextcurlevel ~-1 + ) else self#updownlevel ~-1 in coe o -- 2.11.4.GIT