Skip to content

Editor: Word Wrap setting is ignored #72

Description

@KrisPowers

There is a word wrap option in the editor settings (config), but GpuEditor.tsx does not read or honor it. Long lines always overflow horizontally, forcing horizontal scrolling. There is no way to enable soft line wrapping in the current build.

Word wrap is especially important when editing Markdown, long prose (README files, comments), and minified code where lines can be extremely long.

What needs to happen

  • Read the word wrap setting from the editor config on mount and on settings change.
  • When enabled, calculate the visual wrap points based on the current canvas width and font metrics.
  • Render wrapped visual lines as multiple rows on screen while keeping them as a single logical line in the buffer.
  • All cursor movement (Up/Down arrows, Page Up/Down) should operate on visual lines when word wrap is on.
  • The line number gutter should show the logical line number for each visual line group, or show nothing for continuation rows.
  • The minimap should also reflect wrapped layout.

This is a fairly significant rendering change since the current layout assumes one buffer line = one canvas row.

Files likely involved

  • app/frontend/src/components/GpuEditor.tsx -- main rendering and layout logic
  • app/frontend/src/lib/gpuTextRenderer.ts -- the WebGL2 renderer, may need visual-line awareness
  • app/frontend/src/lib/minimapRenderer.ts -- minimap would need to reflect wrapping
  • Editor settings / config file where the setting already exists

Acceptance criteria

  • Toggling word wrap in settings causes the editor to immediately re-layout without a reload
  • Long lines wrap at the viewport edge with proper visual-line cursor movement
  • Line numbers show logical lines correctly
  • Horizontal scroll disappears when word wrap is on

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions