Compare commits

...

9 Commits

Author SHA1 Message Date
snark13 07c398a560 ChangeLog:
- Russian commentaries.
2026-06-07 22:01:13 +03:00
snark13 4bed9d3f3f fix(mdview): корректный multiline quote join в render_line
- исправлен rewind до первого non-cont сегмента для continuation
- для quote-потока newline обрабатывается как soft join с пропуском сырого ' > ' маркера
- восстановлен quote-префикс на continuation строках

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-06-07 20:26:19 +03:00
snark13 463a058f56 mdview: multiline quote paragraphs with quote-aware joining
- Quote blocks now join consecutive quote lines into one paragraph with
  soft breaks and wrap continuation under quote prefix.
- Empty quote lines ('>' / '>   ') act as quote-paragraph separators.
- Nested quote starts ('> > ...') are not merged into the parent text and
  stay separate rows.
- Keeps existing inline emphasis handling inside quote content.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-06-07 19:24:59 +03:00
snark13 8abc1d6c16 mdview: drop printf from status rendering
Replace status-line printf formatting with compact manual decimal rendering
(u16/u8 right-aligned helpers + wrchar/put_str_attr). This removes runtime
printf usage from mdview.c and keeps fixed status columns without stale digits.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-06-07 19:19:13 +03:00
snark13 982af12710 mdview: multiline list items with lazy continuation and blank-line grouping
- List items (UL/OL) can now span multiple source lines: non-marker
  lines are joined into the current item as lazy continuation.
- Continuation-line leading indentation is trimmed before joining so
  wrapped item text is separated by a single space.
- A single blank line between adjacent list markers is suppressed
  (same visual list), while 2+ blank lines still produce a separator.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-06-07 19:13:02 +03:00
snark13 394ee3a2cd mdview: blank-row block separation; tables nowrap; fix continuation marker
- Paragraph scanning no longer swallows the blank line separating it from
  the next block; runs of blank lines collapse to one row. Restores blank
  separation between paragraphs, headers and horizontal rules.
- Detect table rows (first non-space char '|') as nowrap segments; they are
  no longer merged into surrounding text or each other.
- Continuation (wrapped) rows render content as plain text and are no longer
  re-classified, so a wrapped word starting with '-'/'#'/'>' is not mis-drawn
  as a list/heading/quote marker.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-06-07 12:50:30 +03:00
snark13 47c9cd326a mdview: wide-break '\\', strikethrough, horizontal scroll bounds + '<'
- A trailing backslash before a newline now forces an in-paragraph line
  break (like two trailing spaces); render consumes the marker (non-code).
- Add ~~strikethrough~~ inline style (INIT_STYLE_STRIKE / EM_STRIKE),
  parsed in inline_scan, the paragraph merger and render, mirroring **.
- Horizontal pan is bounded by the widest nowrap segment on screen, and a
  '<' indicator marks hidden content off the left edge.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-06-07 11:55:19 +03:00
snark13 ca5f30b332 mdview: move segment index to EMM bank; inline hot byte reads
- Index is now an 8-byte record per visible segment in a dedicated EMM
  block (idx_get/idx_put), freeing ~11 KB of near RAM and lifting the
  old 2048-line cap (dynamic max_lines = index_pages * 2048).
- The per-byte scan keeps the previous segment offset in a near var
  (cur_seg_off) and mirrors the last record (cur_rec), so it never reads
  the index back from the bank.
- fb()/map_page() are inlined now that there is code headroom, removing
  per-byte call + 32-bit argument marshalling overhead.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-06-07 11:49:36 +03:00
snark13 0ad0559fc8 mdview: faster file-byte access (fb byte-decode + page cache)
Decode page/offset from the 32-bit offset's bytes to avoid SDCC z80
32-bit shift/mask helpers on the hot path; map_page() uses a cached
file_phys[] table to skip mem_get_page() on every W3 swap.
Behaviour-preserving.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-06-07 01:00:49 +03:00
3 changed files with 1191 additions and 641 deletions
+1 -1
View File
@@ -6,5 +6,5 @@
PROJ_ROOT := $(abspath $(CURDIR)/../..)
EXAMPLE := mdview
MEMORY := small
EXTRA_DATA := SAMPLE.MD PLAN_866.md
EXTRA_DATA := SAMPLE.MD PLAN_866.md SAMPLEF.MD
include $(PROJ_ROOT)/app.mk
-165
View File
@@ -1,165 +0,0 @@
# MDVIEW Sample Document
This is a sample Markdown file for testing the Sprinter `mdview` text
viewer. Phase 3 adds inline emphasis: **bold**, *italic* and _underscore_
runs render with distinct background colours.
---
## Section: Inline emphasis
Plain words mixed with **bold words**, *italic words*, _underscore
words_ and `code words` to verify all four styles render with their
own colours.
A single **bold** stretch, then a single *italic* stretch, then a single
_underscore_ stretch, then a single `code` stretch, all on the same line.
A *long italic run that spans multiple words and several columns before
it closes here* and continues plain.
Inline code with punctuation: call `printf("%d\n", x)` then check the
result; or use `argv[0]` to grab the program name.
Unclosed emphasis (open **bold left dangling) — should auto-close at the
end of the line so the next line starts clean.
Conflict cases: **bold with a stray * inside** stays bold, and *italic
with a stray _ inside* stays italic, and `code with **bold** inside`
stays code.
## Section: Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
## Section: Lists
Unordered (dash):
- alpha
- bravo
- charlie
Unordered (asterisk):
* delta
* echo
Unordered (plus):
+ foxtrot
+ golf
Numbered list (digits + period highlighted):
1. first
2. second
3. third
10. tenth — verifies multi-digit numbering
99. ninety-ninth
Numbered with parens:
1) parenthesised one
2) parenthesised two
Nested lists (light v1 — leading spaces enable detection at non-zero col;
no hanging indent in wrap continuation yet):
- top level alpha
- nested level 1 bravo
- nested level 1 charlie
- nested level 2 delta
- nested level 2 echo
- nested level 3 foxtrot
- nested level 1 golf
- top level hotel
Mixed nested:
1. first top
1. nested numeric
2. nested numeric
- mixed bullet under numeric
- another bullet
3. nested numeric
2. second top
## Section: Blockquote
> Single-line blockquote.
> Multi-line blockquote starts here.
> Each line keeps the > prefix highlighted
> while the body stays plain text.
## Section: Code
Inline code: `printf("hello")`.
Fenced block (lines inside should render with code attribute on the
full row, no inline parsing — note the **stars** and *italics* below
remain literal):
```c
int main(void) {
/* **not bold**, *not italic*, `not nested` */
return 42;
}
```
After the block, normal **bold** parsing resumes.
## Section: Long line truncation
This line is intentionally long to verify that the viewer truncates at 80 columns instead of wrapping or scrolling horizontally. Anything past the 80th visible column should simply not appear on screen.
## Section: Tabs
Indented with tabs:
tab-indent level 1
tab-indent level 2
tab-indent level 3
## Section: Blockquote
> Markdown blockquotes start with a greater-than sign at column zero.
> Multiple lines look like this.
### Subsection: deeper heading (H3)
The line above is an H3 — it should render in a colour distinct from
H1 and H2.
#### Subsubsection: H4 and below
H4 (and the rarely-seen H5/H6) all share the H4 colour slot.
***
## Section: Filler
The remaining content exists to make the document scroll past one viewport.
Line 50 ........... approx.
Line 51 ........... .
Line 52 ........... ..
Line 53 ........... ...
Line 54 ........... ....
Line 55 ........... .....
Line 56 ........... ......
Line 57 ........... .......
Line 58 ........... ........
Line 59 ........... .........
Line 60 ........... ..........
End-of-document marker. If you can see this line you can use Home / End
to bounce between the start and finish of the file.
+1190 -475
View File
File diff suppressed because it is too large Load Diff