microsoft / microsoft/monaco-editor

[Bug] 开启wordWrap=‘on’后,有情况文字不连接成一行

Open
#4,941 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Reproducible in vscode.dev or in VS Code Desktop?
  • Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
Monaco Editor Playground Link
Image
Monaco Editor Playground Code
this.editorInstance = editor.create(document.getElementById('editor')!, Object.assign({automaticLayout: true,
  theme: 'myCustomTheme',
  minimap: { // 右侧小地图
    enabled: false,
  },
  quickSuggestions: {
    other: true,
    comments: false,
    strings: true
  },
  formatOnType: true,
  // 启用上下文菜单
  contextmenu: false,}, {
				model: editor.createModel('', 'yaml', Uri.parse('docker-compose.yml')),
				readOnly: this.readOnly, // 设置为只读
				wordWrap: "on",
				wrappingStrategy: "advanced"
			} as any))
Reproduction Steps

英文和数字相连就会出现断层问题,通过chrome审查元素得出是monaco editor自己用span包裹并分割了。所以是编辑器自身问题

Image
Actual (Problematic) Behavior

No response

Expected Behavior

没有空格和回车的情况下不换行

Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided Monaco Editor Playground configuration, especially editor.create with wordWrap set to "on" and wrappingStrategy set to "advanced". Reproduce the reported break in connected English and numeric text, then verify that text without spaces or newlines wraps continuously without the observed gaps or splits.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.