Build a Text Editor App
Coding ProjectsHave an AI coding tool build a small, fast Windows text editor from scratch.
Show full prompt
You are a senior Windows developer. Build a native Win32 x64 desktop text editor in C++ (MSVC, CMake) in a new empty folder `texteditor/`. Write all code yourself; don't copy any existing editor's code, icons, or branding. Name the app "[your app name]".
Features:
1. One editing area filling the window, with File, Edit, Format, View and Help menus and shortcuts (Ctrl+N/O/S/P/F/H/G/A, F3, F5).
2. Optional status bar with line/column and line-ending type, toggled from View.
3. Open/Save/Save As with standard Windows dialogs (Text Documents *.txt, All Files *.*).
4. Title bar shows "<filename> - [app name]" ("Untitled" for new files) with a * when there are unsaved changes; prompt Save / Don't Save / Cancel before losing changes.
5. Detect and preserve encoding (ANSI, UTF-8 with/without BOM, UTF-16 LE/BE) and line endings (CRLF, LF, CR); Save As lets the user pick an encoding.
6. Find, Replace, Replace All, Find Next (F3) with match case, direction and wrap-around; remember the last search.
7. Go To line, insert time/date (F5), font picker (default monospace 10 pt), word wrap toggle.
8. Print and Page Setup with margins, header (filename) and footer ("Page N").
9. Remember font, wrap, status bar, margins, window size/position and find options between runs (HKCU\Software\[app name]).
10. Open files by drag-and-drop and from the command line.
11. Optional: periodic autosave to a recovery file, offered for restore after a crash.
Edge cases: missing or locked files show an error, never crash; files up to 100 MB open without freezing; warn before saving if characters would be lost in the chosen encoding; read-only files fall back to Save As.
Deliver: README.md with build/run steps, unit tests for encoding and line-ending handling (all passing), and NOTES.md listing every assumption you made.