# Specification: Advanced Text Viewer with Syntax Highlighting

## Overview
Enhance the existing "Text Viewer" popup panel in the Manual Slop GUI to support rich rendering, including syntax highlighting for various code types and Markdown rendering. The viewer will transition from a basic text/multiline input to a specialized component leveraging the project's hybrid rendering pattern.

## Functional Requirements
- **Rich Rendering Support:**
  - **Code:** Integration with `ImGuiColorTextEdit` for syntax highlighting (Python, PowerShell, JSON, TOML, etc.).
  - **Markdown:** Integration with `imgui_markdown` for rendering formatted text and documents.
  - **Fallback:** Plain text rendering for unknown or unspecified types.
- **Explicit Type Specification:**
  - The component/function triggering the viewer (e.g., `_render_text_viewer`) must provide an explicit `text_type` parameter (e.g., "python", "markdown", "text").
- **Enhanced UI Features:**
  - **Line Numbers:** Display line numbers in the gutter when viewing code.
  - **Copy Button:** A dedicated button to copy the entire content to the clipboard.
  - **Independent Word Wrap:** A toggle within the viewer window to enable/disable word wrapping specifically for that instance, overriding the global GUI setting if necessary.
  - **Persistent Sizing:** The viewer should maintain its size/position via ImGui's standard `.ini` persistence.

## Technical Implementation
- Update `App` state in `src/gui_2.py` to store `text_viewer_type`.
- Modify `_render_text_viewer` signature to accept `text_type`.
- Update the rendering loop in `_gui_func` to switch between `MarkdownRenderer` logic and `TextEditor` logic based on `text_viewer_type`.
- Ensure proper caching of `TextEditor` instances to maintain scroll position and selection state while the viewer is open.

## Acceptance Criteria
- [ ] Clicking a preview button for a Python file opens the viewer with syntax highlighting and line numbers.
- [ ] Clicking a preview for a `.md` file renders it as formatted Markdown.
- [ ] The "Copy" button correctly copies text to the OS clipboard.
- [ ] The word wrap toggle works immediately without affecting other panels.
- [ ] Unsupported types gracefully fall back to standard plain text.
