Files
RedBear-OS/local
kellito dfd75b52f6 tlc: Sprint 3 C18 — format paragraph preserves code blocks
Previously reformat_paragraph_at() would join indented lines
together, destroying intentional indentation (Python code,
shell heredocs, ASCII art, markdown sub-blocks).

Now reformat_paragraph_at() detects code blocks (paragraphs
where every non-blank line begins with whitespace) and
returns the text unchanged. The detection is intentionally
conservative — false positives leave the paragraph alone
rather than destroying user-written indentation.

format.rs:
  - New is_code_block(paragraph) helper
  - reformat_paragraph_at() calls is_code_block(); if true,
    returns text unchanged (preserving indentation)

Tests (6 new in editor::format::tests):
  - is_code_block_detects_indented_paragraph
  - is_code_block_rejects_unindented_paragraph
  - is_code_block_ignores_blank_lines_in_paragraph
  - reformat_paragraph_skips_code_block
  - reformat_paragraph_skips_shell_heredoc
  - reformat_paragraph_handles_mixed_code_and_prose

Total: 1289 passing (was 1283; +6 new).
2026-07-05 19:31:33 +03:00
..