Skip to content

Add optional soft wrapping to equation source #34

Closed

Description

@BinaryOutlook

Stage 3 — Layout and writing preferences

Synopsis

Make long equation source visually wrap within its editor so users can see what they are typing without inserting manual line breaks.

End goal

Long equations remain comfortable to edit while their authored characters and mathematical structure remain unchanged.

Start after

No prerequisite issue. This work can start independently from freshly fetched origin/main; stage numbering does not require waiting for every earlier milestone. Use the repository's dedicated feature-branch/worktree workflow and record the actual base revision.

Agreed scope

  • Wrap editable equation source only. Automatic line breaking of the rendered mathematical expression is outside this issue.
  • Soft wrapping must never insert source newlines, TeX row breaks, or formatting commands.
  • Make wrapping independently configurable and persistent in both hosts; retain the current no-wrap behavior as the initial default.
  • Preserve intentional spaces, blank lines, trailing source lines, and original supported delimiter forms.

Acceptance criteria

  • When enabled, long source stays visible through visual wrapping across pane and font-size changes; disabling restores the previous scrolling behavior.
  • Typing, caret movement, selection, Home/End behavior as documented, copy/paste, and input-method composition remain usable on wrapped lines.
  • Copied/source/saved text matches the authored input exactly; visual wraps do not become source line breaks or new undo operations.
  • Live preview, invalid/incomplete expressions, source placement, source switching, and save/reopen remain correct.

Verification

  • Use long unbroken expressions, expressions with spaces, multi-line source with intentional blank lines, and Unicode/IME input.
  • Check byte/text equality before and after toggling wrapping, copying, saving/reopening, and resizing.
  • Exercise production browser editing and both host settings paths; add regressions for actual wrapping-related failures.

Source pointers

  • src/webview/styles.css
  • src/webview/editor.js
  • src/editorProvider.ts
  • electron/src/settings-manager.ts
  • package.json
  • test/specs/equation-compatibility.spec.ts
  • test/specs/equation-background-sync.spec.ts

Delivery contract

Implement the shared editor behavior in both VS Code and Electron. View-only settings/actions must preserve Markdown, selection/editing context, clean state, and undo history. For new or changed settings, keep host wiring, manifest descriptions, all supported translations, and documentation consistent. Preserve existing identifiers and defaults except for the deliberate changes specified above.

Work from the repository root using the Node version in .node-version and the maintained instructions in CONTRIBUTING.md, docs/building.md, and docs/testing/README.md; export changes also follow docs/export-verification.md. Run full compilation after webview JavaScript/CSS, shared-module, or translation changes, plus checks that exercise the changed behavior. Rebuild and reinstall for installed-extension evidence. Report failures/skips honestly; follow required CI and review gates. Update affected documentation and review any committed Markdown in source and rendered form.

Link the PR or investigation to this issue. Keep remediation on the same focused work item where practical. Completion requires the stated evidence and accepted outcome; opening a draft PR does not complete the issue. No deadline or assignee is imposed by this issue.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions