Reproduction:
#import "@preview/codly:1.3.0"
#show: codly.codly-init
#let code = ```
first
middle
last
```
#code // reference
#codly.codly(
smart-skip: true,
ranges: ((1, 1), (3, 3), (5, 5)),
)
#code // two smart skips (lines 2 and 4)
#codly.codly(
smart-skip: (first: false, last: false, rest: true),
ranges: ((1, 1), (3, 3), (5, 5)),
)
#code // line 2 has a smart skip, line 4 has not
In the last example, the error is visible. It should render as
first
...
middle
...
last
but instead we get
it seems that the smart-skip feature detects line 4 as being the "last" when the final range only contains the last line as a single line. If the code snippet was
then we get the expected result. Likewise, if (with this snippet) the final range was (5, 6), i.e. more than one line, the result is also correct.