astrale-sharp / typstfmt

Apache License 2.0
253 stars 25 forks source link

Don't replace blank spaces in line with new lines #132

Closed ivaquero closed 11 months ago

ivaquero commented 11 months ago

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

Describe the bug In a Chinese doc, there are blank spaces between English letters and Chinese characters, howerever, typstfmt replaces these blank spaces in line with new lines.

image

Please, make "replace blank spaces in line with new lines" an optional.

To Reproduce Steps to reproduce the behavior:

typstfmt article.typ
git diff article.typ
astrale-sharp commented 11 months ago

Hey there :)

thanks for the report, could you provide the string tested and the result after please?

ivaquero commented 11 months ago

Sure. The string tested

#h(2em) 构建系统(build system),又称构建器,是用来从源代码生成用户可以使用的目标(targets)的自动化工具。目标可以包括库、可执行文件、或者生成的脚本等等。

the result after

#h(2em) 构建系统(build
system),又称构建器,是用来从源代码生成用户可以使用的目标(targets)的自动化工具。目标可以包括库、可执行文件、或者生成的脚本等等。
astrale-sharp commented 11 months ago

Thank you

If I understand correctly, your problem is the inserted newline after build?

astrale-sharp commented 11 months ago

If so, have you tried setting line_wrap = false in your config file?

ivaquero commented 11 months ago

You are right line_wrap = false works. Thank you!

However, I would like to report another issue. https://github.com/astrale-sharp/typstfmt/issues/134

astrale-sharp commented 11 months ago

Sure! I'll go ahead and close this one!