Search highlights now appear in the rendered markdown view (including table cells), and all floating overlay panels use consistent z-order stacking via egui::Order::Foreground.
Search highlights (from Ctrl+F) only appeared in the raw editor (FerriteEditor). The rendered WYSIWYG view and split preview pane showed no search match highlighting, making it difficult to locate matches when viewing formatted content — especially in tables where cell geometry differs from raw source lines.
MarkdownEditor now accepts search match byte ranges and paints semi-transparent highlight overlays during the viewport rendering pass.
Key changes:
| File | Change |
|---|---|
src/markdown/editor.rs |
Added search_highlights / current_search_match fields to MarkdownEditor, builder method .search_highlights(matches, current), and paint_rendered_search_highlights() function |
src/app/central_panel.rs |
Wire FindState matches into MarkdownEditor for both full rendered view and split preview pane |
central_panel.rspassesFindState.matches(byte position pairs) andcurrent_matchindex toMarkdownEditorvia the builder.- Inside
show_rendered_editor, after each visible block renders,paint_rendered_search_highlights()checks if any match byte ranges overlap the block's source line range. - For table blocks: highlights are subdivided into per-row strips. The separator line (e.g.,
|---|---|) is skipped. Each data row gets its own highlight rect. - For non-table blocks (paragraphs, headings, lists): a proportional strip is painted at the approximate Y position within the block.
- The current match uses a brighter color (yellow/orange); other matches use a dimmer semi-transparent yellow.
line_start_byte_offsets()(already in codebase) provides a byte offset → line number lookup via binary search.- Each rendered block tracks
y_before/y_afterfromui.cursor().top(). - For tables, row positions are approximated by dividing the block height evenly across visual rows (header + data, minus the separator line).
Floating overlay panels (Find/Replace, Go to Line, Search in Files, file operation dialogs) used egui::Window with no explicit ordering. Their stacking depended on paint order within the frame, causing panels to sometimes appear behind the editor or other chrome — especially after window resize, tab switch, or theme change.
All floating overlay panels now use .order(egui::Order::Foreground), ensuring they consistently render above the main editor content.
| Panel | File | Change |
|---|---|---|
| Find/Replace | src/editor/find_replace.rs |
Added .order(egui::Order::Foreground) |
| Go to Line | src/ui/dialogs.rs |
Added .order(egui::Order::Foreground) |
| Search in Files | src/ui/search.rs |
Added .order(egui::Order::Foreground) |
| File Create/Rename/Delete | src/ui/dialogs.rs |
Added .order(egui::Order::Foreground) |
| Unsaved Changes | src/app/dialogs.rs |
Added .order(egui::Order::Foreground) |
| Error Modal | src/app/dialogs.rs |
Added .order(egui::Order::Foreground) |
| Portal Error | src/app/dialogs.rs |
Added .order(egui::Order::Foreground) |
| Quick Switcher | src/ui/quick_switcher.rs |
Already used Order::Foreground (no change) |
Within Order::Foreground, panels painted later in the frame appear on top. The composition order in central_panel.rs is:
render_dialogs()— Find/Replace, unsaved changes, error modals- Quick Switcher overlay
- File operation dialogs
- Go to Line dialog
- Search in Files panel
This means modal-like panels (Quick Switcher, Go to Line) naturally stack above utility panels (Find/Replace), which is the intended UX.