mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 16:05:11 +00:00
Previously, the Editor component used character-level (grapheme-level) wrapping, which broke words mid-character at line boundaries. This created an ugly visual experience when typing or pasting long text. Now the Editor uses word-aware wrapping: - Wraps at word boundaries when possible - Falls back to character-level wrapping for tokens wider than the available width (e.g., long URLs) - Strips leading whitespace at line starts - Preserves multiple spaces within lines Added wordWrapLine() helper function that tokenizes text into words and whitespace runs, then builds chunks that fit within the specified width while respecting word boundaries. Also updated buildVisualLineMap() to use the same word wrapping logic for consistent cursor navigation. Added tests for: - Word boundary wrapping - Leading whitespace stripping - Long token (URL) character-level fallback - Multiple space preservation - Edge cases (empty string, exact fit)
31 lines
1.7 KiB
Markdown
31 lines
1.7 KiB
Markdown
# Changelog
|
|
|
|
## [Unreleased]
|
|
|
|
### Added
|
|
|
|
- `isShiftCtrlO()` key detection function for Shift+Ctrl+O (Kitty protocol)
|
|
- `isShiftCtrlD()` key detection function for Shift+Ctrl+D (Kitty protocol)
|
|
- `TUI.onDebug` callback for global debug key handling (Shift+Ctrl+D)
|
|
- `wrapTextWithAnsi()` utility now exported (wraps text to width, preserving ANSI codes)
|
|
|
|
### Changed
|
|
|
|
- README.md completely rewritten with accurate component documentation, theme interfaces, and examples
|
|
- Editor component now uses word wrapping instead of character-level wrapping for better readability
|
|
|
|
### Fixed
|
|
|
|
- Markdown component now renders HTML tags as plain text instead of silently dropping them ([#359](https://github.com/badlogic/pi-mono/issues/359))
|
|
|
|
## [0.29.0] - 2025-12-25
|
|
|
|
### Added
|
|
|
|
- **Auto-space before pasted file paths**: When pasting a file path (starting with `/`, `~`, or `.`) and the cursor is after a word character, a space is automatically prepended for better readability. Useful when dragging screenshots from macOS. ([#307](https://github.com/badlogic/pi-mono/pull/307) by [@mitsuhiko](https://github.com/mitsuhiko))
|
|
- **Word navigation for Input component**: Added Ctrl+Left/Right and Alt+Left/Right support for word-by-word cursor movement. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
|
|
- **Full Unicode input**: Input component now accepts Unicode characters beyond ASCII. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
|
|
|
|
### Fixed
|
|
|
|
- **Readline-style Ctrl+W**: Now skips trailing whitespace before deleting the preceding word, matching standard readline behavior. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
|