How to narrow line spacing in code blocks with codly

I am using Typst to create code blocks, but I’m having trouble narrowing the vertical space between lines. Even after trying several layout settings, the line spacing remains quite large—almost as tall as the characters themselves.

Below is the relevant part of my code and the image of the code block I wrote. Could anyone point out what I might be missing or how to properly reduce the line spacing?

#import "@preview/codly:1.3.0": *
#import "@preview/codly-languages:0.1.1": *

#show: codly-init.with()

#codly(

  languages: codly-languages, 
  
  number-format: n => text(fill: luma(150), size: 0.9em)[#n],
  
  zebra-fill: luma(250),   
  stroke: 0.5pt + luma(200),
  radius: 3pt,              
  
  smart-indent: true,
  inset: 0em,
  breakable: true
)
#show raw: it => {
  set text(size: 8.5pt)
  
  set par(leading: 0em)
  
  it
}

the result:

Hi, welcome to the Typst forum! Please have a look at this post to see how to format your code example so we can see it correctly.

1 Like

thank you for your advice! I edited my post!

1 Like

Thanks! I tried your code, with the addition of a small raw block below, and I can’t reproduce the problem:

// your code

```
a b
c d
```

image

I’m using Typst 0.14.2. Which version do you have? Any chance you could share an example on the Web app that shows the problem?

1 Like

Thank you for your kind assistance!
While I was creating a minimal example on the Web app as you suggestted, I figured out the problem! It turns out this specific line in my global setting was causing the issue.

#set grid(gutter: 10pt, align: horizon)

Thank you so much for helping me notice this!

1 Like

You’re welcome!