Skip to content

Commit 8b9b1e1

Browse files
Modularize prose_code.c into 12 modules + shared header
Split the monolithic 6,327-line prose_code.c into logically organized modules following MODULARIZATION.md: - prose_code.h: shared header with all types, macros, externs, prototypes - buffer.c: arena allocator, gap buffer, line cache, wrap cache, undo stack - theme.c: dark/light themes and DPI scaling - spell.c: Windows ISpellChecker COM integration with static GUIDs - syntax.c: C and Markdown tokenizers, keyword hash table - document.c: document lifecycle, line/column math, gutter width - editor.c: text editing ops, clipboard, undo/redo, cursor movement - search.c: find/replace with match highlighting - menu.c: menu definitions and action dispatch - file_io.c: file I/O, atomic saves, autosave/crash recovery, tab management - render.c: all GDI rendering (titlebar, tabs, editor, minimap, stats) - wndproc.c: window procedure, input handling, bracket matching - main.c: entry point, app icon, EditorState global Also adds Makefile and GitHub Actions CI workflow for cross-compilation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 745e09f commit 8b9b1e1

15 files changed

Lines changed: 6056 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build
2+
on:
3+
push:
4+
branches: [ main, master, 'claude/**' ]
5+
pull_request:
6+
branches: [ main, master ]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Install MinGW-w64
15+
run: sudo apt-get update && sudo apt-get install -y gcc-mingw-w64-x86-64
16+
17+
- name: Build
18+
run: make CC=x86_64-w64-mingw32-gcc
19+
20+
- name: Upload artifact
21+
uses: actions/upload-artifact@v4
22+
with:
23+
name: prose_code
24+
path: prose_code.exe

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
CC ?= x86_64-w64-mingw32-gcc
2+
WINDRES ?= x86_64-w64-mingw32-windres
3+
CFLAGS = -O2 -Wall -Wextra -Wno-unused-parameter -municode \
4+
-DUNICODE -D_UNICODE -DCOBJMACROS
5+
LDFLAGS = -mwindows -municode
6+
LIBS = -lgdi32 -lcomdlg32 -lcomctl32 -lshell32 -lole32 \
7+
-lshlwapi -ldwmapi -luxtheme
8+
9+
SRCS = main.c buffer.c theme.c spell.c syntax.c document.c \
10+
editor.c search.c menu.c file_io.c render.c wndproc.c
11+
OBJS = $(SRCS:.c=.o)
12+
TARGET = prose_code.exe
13+
14+
all: $(TARGET)
15+
16+
$(TARGET): $(OBJS)
17+
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
18+
19+
%.o: %.c prose_code.h
20+
$(CC) $(CFLAGS) -c -o $@ $<
21+
22+
clean:
23+
rm -f $(OBJS) $(TARGET)
24+
25+
.PHONY: all clean

0 commit comments

Comments
 (0)