microsoft / vscode

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

global "editor.wordWrap": "off": doesn't work for markdown files #201622

Closed YawKar closed 10 months ago

YawKar commented 10 months ago

Type: Bug

If I set "editor.wordWrap": "off" globally in my Code/User/settings.json file, markdown files will still word wrapping. However, if I set "[markdown]": { "editor.wordWrap": "off" }, markdown files will not word wrapping.

It seems like global setting from User's settings.json (which is the only one I always hack) don't advance to the level of Markdown editor?

Btw, here is devcontainer that I used (if it'll somehow help):

{
    "name": "Ubuntu",
    "image": "mcr.microsoft.com/devcontainers/base:jammy",
    "features": {
        "ghcr.io/devcontainers/features/go:1": {}
    }
}

VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:49:37.021Z) OS version: Windows_NT x64 10.0.22631 Modes: Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 x 2592)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.87GB (3.08GB free)| |Process Argv|--crash-reporter-id 6823072e-cf1a-450a-b56d-175752daa101| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|Dev Container: Ubuntu| |OS|Linux x64 5.15.133.1-microsoft-standard-WSL2| |CPUs|Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 x 2592)| |Memory (System)|7.69GB (5.85GB free)| |VM|0%|
Extensions (16) Extension|Author (truncated)|Version ---|---|--- project-manager|ale|12.7.0 remote-containers|ms-|0.327.0 remote-ssh|ms-|0.107.1 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.81.8 vscode-remote-extensionpack|ms-|0.25.0 remote-explorer|ms-|0.4.1 remote-server|ms-|1.5.0 vim|vsc|1.27.2 vim-cheatsheet|And|0.0.1 go|gol|0.40.1 todo-tree|Gru|0.0.226 nerdtree|Lla|1.2.1 indent-rainbow|ode|8.3.1 trailing-spaces|sha|0.4.1 markdown-all-in-one|yzh|3.5.1 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242cf:30382550 vsjup518:30340749 vshan820:30294714 vscorecescf:30445987 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 py29gd2263:30899288 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 azure-dev_surveyone:30548225 f6dab269:30613381 showlangstatbar:30737416 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30902429 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:30885898 pythontbext0:30879054 accentitlementst:30887150 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 dsvsc019:30917259 cp7184c:30925681 ```
mjbvz commented 10 months ago

See https://stackoverflow.com/questions/62127203/vscode-word-wrap-for-markdown-not-working

Markdown provides a language specific setting for word wrap by default:

Image

boltex commented 9 months ago

@mjbvz Sorry if it's inappropriate to ask this here: but as an extension developer, I wonder how do I define this for a new 'documentation' language my extension defines? (to have wrap by default, like markdown) I've looked at the vscode api for defining languages, but I see no way of setting 'wrap' on by default like the markdown language does.

Thanks! :D

memeplex commented 8 months ago

@mjbvz could it be that these "default language specific settings" override multiple language settings, like in:

  "[markdown][typst]": {
    "editor.wordWrap": "bounded",
    "editor.tabSize": 4,
    "editor.lineNumbers": "off",
    "editor.rulers": [],
  },

The two last options are set, tabSize only for markdown, and the first one for none of them. I have to set the options individually for each language. Maybe I should file an issue for this, I don't think this behavior is convenient or intuitive.