From 9a1494da97db8d928dc6718cf36ddd68495b28c8 Mon Sep 17 00:00:00 2001 From: Karl Dyrhage Date: Wed, 20 Sep 2023 10:25:24 +0200 Subject: [PATCH] Fixes #13 --- src/utils.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils.jl b/src/utils.jl index 5232664..6d481a3 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -24,12 +24,14 @@ function findbreak(v, t; width = 80, margin = 21) 1 j = i+t-1 j >= lastindex(v) && return nothing - x = findlast(c -> c == ' ' || c == '-', v[1:j]) + x = findlast(c -> c == ' ' || c == '-', v[j-t+1:j]) if isnothing(x) return j:j+1 - elseif x == ' ' + elseif v[x] == ' ' + x += j - t return x-1:x+1 else + x += j - t return x:x+1 end end