Skip to content

Commit dbc15fe

Browse files
committed
Add MultilineEditControl documentation, update rendering pipeline docs
MultilineEditControl.md: comprehensive documentation covering all features including syntax highlighting (ISyntaxHighlighter), pluggable gutter system (IGutterRenderer), find/replace API, undo/redo, word wrap modes, keyboard shortcuts, mouse interaction, per-line highlights, and extensibility examples (breakpoint gutter, code editor, log viewer patterns). CONTROLS.md: linked MultilineEditControl with updated description. RENDERING_PIPELINE.md: updated SetCell documentation to reflect the SetCell(Cell) / SetNarrowCell(char/Rune) API split. The old SetCell(x, y, Rune, Color, Color) was renamed to SetNarrowCell to make misuse a compile error.
1 parent d05f6c1 commit dbc15fe

3 files changed

Lines changed: 590 additions & 6 deletions

File tree

docs/CONTROLS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Controls for user input and interaction.
3737
| **[DatePickerControl](controls/DatePickerControl.md)** | Locale-aware date picker | Segmented editing, calendar popup, min/max dates |
3838
| **[PromptControl](controls/PromptControl.md)** | Single-line text input | Enter key events, input validation, max length |
3939
| **[TimePickerControl](controls/TimePickerControl.md)** | Locale-aware time picker | 12h/24h modes, seconds toggle, min/max times |
40-
| **MultilineEditControl** | Multi-line text editor | Scrolling, word wrap, text selection |
40+
| **[MultilineEditControl](controls/MultilineEditControl.md)** | Multi-line text editor | Syntax highlighting, pluggable gutter, find/replace, undo/redo, word wrap |
4141
| **[SliderControl](controls/SliderControl.md)** | Value slider with thumb | Horizontal/vertical, step/large-step, keyboard/mouse drag |
4242
| **[RangeSliderControl](controls/RangeSliderControl.md)** | Dual-thumb range slider | MinRange enforcement, tab to switch thumbs, range events |
4343

docs/RENDERING_PIPELINE.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,14 +447,26 @@ private void PaintStage(CharacterBuffer buffer)
447447

448448
**CharacterBuffer key methods:**
449449
```csharp
450-
// Individual cell (char overload wraps in Rune internally)
451-
void SetCell(int x, int y, Rune character, Color fg, Color bg);
450+
// Full Cell (preserves flags: IsWideContinuation, Combiners, Decorations)
451+
// Use for parsed markup cells and cell copies between buffers
452+
void SetCell(int x, int y, Cell cell);
453+
454+
// Narrow character (clears all flags, assumes width-1)
455+
// Use for literal characters: borders, padding, fill chars, track chars
456+
void SetNarrowCell(int x, int y, char character, Color fg, Color bg);
457+
void SetNarrowCell(int x, int y, Rune character, Color fg, Color bg);
458+
452459
// Text rendering with automatic wide character and combiner handling
453460
void WriteString(int x, int y, string text, Color fg, Color bg);
461+
454462
// Bulk fill
455463
void FillRect(LayoutRect rect, char c, Color fg, Color bg);
456464
```
457465

466+
> **Note:** The old `SetCell(x, y, Rune, Color, Color)` overload was renamed to `SetNarrowCell`
467+
> to make misuse a compile error. Use `SetCell(Cell)` for parsed/copied cells, `SetNarrowCell`
468+
> for literal narrow characters.
469+
458470
#### Stage 3.5: Pre/Post Buffer Paint Hooks (Compositor Effects)
459471
*File: `Windows/WindowRenderer.cs`*
460472

@@ -578,13 +590,18 @@ R1 │ 'l', W, B │ │ 'o', W, B │ │ ' ', W, B │
578590

579591
### Key Operations
580592

581-
#### 1. SetCell (Individual Cell Update)
593+
#### 1. SetCell / SetNarrowCell (Individual Cell Update)
582594
*File: `CharacterBuffer.cs`*
583595

584-
Accepts both `char` (convenience overload, wraps in `Rune`) and `Rune` (primary):
596+
Two write APIs with distinct purposes:
597+
598+
- **`SetCell(int x, int y, Cell cell)`** — preserves all flags (`IsWideContinuation`, `Combiners`, `Decorations`). Use for cells from `MarkupParser.Parse()` or when copying cells between buffers.
599+
- **`SetNarrowCell(int x, int y, char/Rune, Color fg, Color bg)`** — clears all flags, assumes width-1. Use for literal narrow characters: border chars, padding spaces, fill chars.
600+
601+
> The old `SetCell(x, y, Rune, Color, Color)` overload was renamed to `SetNarrowCell` to make misuse a compile error.
585602
586603
```csharp
587-
public void SetCell(int x, int y, Rune character, Color foreground, Color background)
604+
public void SetNarrowCell(int x, int y, Rune character, Color foreground, Color background)
588605
{
589606
if (x < 0 || x >= Width || y < 0 || y >= Height)
590607
return;

0 commit comments

Comments
 (0)