CONTINUATION_PROMPT.md 1.8 KB

Lumacs Development Continuation Prompt

Copy this entire prompt to start a new conversation and continue development:


I'm working on Lumacs, an Emacs-inspired text editor written in C++20 with ncurses, GTK4, and Lua scripting. The project is located at /Users/user/Projects/lumacs.

Current Status

Phase 6: GTK4 Frontend - PROTOTYPE WORKING

  • Build: Successful, single binary lumacs.
  • GTK4 Frontend:
    • Default mode.
    • Renders text using Pango/Cairo with syntax highlighting.
    • Handles keyboard input with modifiers.
    • Known Issue: Crashes on exit (double free).
  • TUI Frontend: Available via -nw flag.
  • Lua API: Stable and fully integrated.

Recent Accomplishments

1. GTK4 Integration

  • Implemented GtkEditor class (src/gtk_editor.cpp).
  • Configured CMakeLists.txt to optionally build with gtkmm-4.0.
  • Implemented key mapping from GDK events to Lumacs key strings.
  • Implemented text rendering with Pango Font Metrics.

2. Face System

  • Lua API for define_face and inheritance works.
  • Themes (Everforest, Dracula) work in both TUI and GUI.

Next Steps

Priority 1: Fix Crash on Exit

  • Investigate Gtk::Application and Window lifetime management in src/gtk_editor.cpp.

Priority 2: Scrolling & Viewport

  • Implement scrolling logic in GtkEditor::on_draw (currently text is just drawn from (0,0)).
  • Handle horizontal scrolling or wrapping.

Priority 3: UI Polish

  • Implement Mode Line in GTK (currently only text area is drawn).
  • Implement Minibuffer in GTK.

Testing Instructions

Build:

./scripts/build.sh

Run GUI:

./build/lumacs

Run TUI:

./build/lumacs -nw

GTK4 Frontend is interactive! Text and Cursor are visible. Input works.