microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.66k stars 29.05k forks source link

Text does not wrap properly when non-monospaced fonts are used #152921

Closed rbn30117 closed 2 years ago

rbn30117 commented 2 years ago

Issue Type: Bug

Changing the default font in VS code (e.g. to 'Segoe UI' or Arial) makes it's word wrap to limit itself to 80 characters instead of the viewport width (see https://prnt.sc/fiGzMOCkNGNP)

VS Code version: Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630, 2022-06-14T12:48:58.283Z) OS version: Windows_NT x64 10.0.19044 Restricted Mode: No

Extensions (3) Extension|Author (truncated)|Version ---|---|--- language-hugo-vscode|bud|1.3.1 better-toml|bun|0.3.2 hugo-shortcode-syntax|kae|1.0.0 (1 theme extensions excluded)
roblourens commented 2 years ago

Probably a limitation of non-monospaced fonts

rbn30117 commented 2 years ago

Probably a limitation of non-monospaced fonts

This works properly in the previous editor I used (Sublime Text), and I want to retain the same feature for my markdown files. Using monospaced fonts to write is not a bliss. I also have a use case where I extract data from PDF files and some PDF files don't have proper paragraphs in place with texts wrapping to the next line unexpectedly, which is difficult to detect with this bug.

alexdima commented 2 years ago

@stullesha For performance reasons, the default wrapping strategy makes assumptions about the character widths. If you are using a non-monospace font you can configure "editor.wrappingStrategy": "advanced", which will be slower, but correct.