prevent drawing separators on starting lines of fields #17

Open
rajayonin wants to merge 1 commits from rajayonin/rivet-typst:fix-consecutive-ranges into dev

View File

@@ -387,8 +387,10 @@
}
let range-boundaries = ()
for r in struct.ranges.values() {
let i = to-real-i(if config.ltr-bits {r.start} else {r.end})
range-boundaries.push(i)
let start-i = to-real-i(if config.ltr-bits {r.start} else {r.end})
let end-i = to-real-i(if config.ltr-bits {r.end} else {r.start}) + 1
range-boundaries.push(start-i)
range-boundaries.push(end-i)
}
rajayonin marked this conversation as resolved Outdated
Outdated
Review

Not really useful since we're only checking if an index is in the list later on (line 431/434)

Also, dedup doesn't modify the array in place so the result should be reassigned to the variable

range-boundaries = range-boundaries.dedup()
Not really useful since we're only checking if an index is in the list later on (line 431/434) Also, `dedup` doesn't modify the array in place so the result should be reassigned to the variable ```typst range-boundaries = range-boundaries.dedup() ```

Not really useful since we're only checking if an index is in the list later on (line 431/434)

What do you suggest we do instead?

> Not really useful since we're only checking if an index is in the list later on (line 431/434) What do you suggest we do instead?
Outdated
Review

It seems like removing duplicates is not really necessary because the only time we read from the list is to check whether it contains particular indices. I'd suggest not calling dedup at all

It seems like removing duplicates is not really necessary because the only time we read from the list is to check whether it contains particular indices. I'd suggest not calling `dedup` at all

Ok, done.

Ok, done.
// Draw colors