typstfmt icon indicating copy to clipboard operation
typstfmt copied to clipboard

Extra new line and trailing comma in `mat`

Open TheJiahao opened this issue 2 years ago • 0 comments

  • [x] I have tested with the master version of typstfmt and not just typst-lsp

Describe the bug Extra comma and new line inserted to long mat calls with named parameters before entries and semicolon. Almost same as #102, tested with typstfmt v0.2.9.

To Reproduce Minimal working examples:

$
mat(delim: "[", 0123456789012345678901234567890123456789012345678901234567;)
$
$
mat(delim: "[", 0123456789012345678901234567890123456789012345678901234567;0)
$

Steps to reproduce the behavior:

  1. Run typstfmt once:

    $
      mat(
        delim: "[", 0123456789012345678901234567890123456789012345678901234567;,
    
      )
    $
    
  2. Rerun typstfmt

    $
      mat(
        delim: "[", 0123456789012345678901234567890123456789012345678901234567;, ,
    
      )
    $
    
  3. Repeat 2. and typstfmt adds extra comma every time.

TheJiahao avatar Mar 24 '24 12:03 TheJiahao