Skip to content

[FEATURE REQUEST] CodeEditor 能不能加个软换行(word wrap)? #25

Backlog

Description

@WeiyangPro

Component

CodeEditor

What it is for

ElyCode 是我在用 Ely GPUI 写的项目,编辑器部分直接用的 Ely CodeEditor。现在遇到很长的代码行、日志行时只能左右滚,没有 VSCode 那种自动换行,用起来有点难受。

想在设置里加个“换行显示”开关:默认关闭,开启后长行按编辑区宽度折行显示。

How it should behave

  • 默认关闭,不影响现在已有的行为。
  • 开启后长行按宽度折成视觉行;逻辑行号还是原来的行号,行号栏、折叠、选择、光标移动、鼠标点击、IME、查找这些别错位。
  • 中文、宽字符、Tab 和超长单行也别出问题。
  • 关闭后恢复原来的横向滚动。
  • API 你们怎么定都行,比如 Options 或 CodeEditor 上有个 .soft_wrap(bool) 之类的;我这边可以接。

References

VSCode 的 Word Wrap:https://code.visualstudio.com/docs/editor/codebasics#_word-wrap

ElyCode 当前没有这个能力,应用层也补不了,所以先来问问组件层愿不愿意支持。不急,主要想知道方向。

Checked

  • I searched the components page at elygpui.com and the open issues.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions