Skip to content

Commit 2fe6e0a

Browse files
committed
updated roadmap
1 parent 99676fc commit 2fe6e0a

File tree

1 file changed

+53
-6
lines changed

1 file changed

+53
-6
lines changed

ROADMAP.md

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
This roadmap outlines future development for Loki, organized around the **modular architecture principle**: keep core components focused on essential infrastructure while adding capabilities through feature modules.
44

5-
## Current Status (v0.4.x)
5+
## Current Status (v0.4.8)
66

77
**Project Metrics:**
88

9-
- **Core:** ~1,150 lines (loki_core.c) - below 1,500 line target ✅
10-
- **Total codebase:** ~9,700 lines across modular components
9+
- **Core:** **891 lines** (loki_core.c) - **33% below 1,000 line milestone!** 🎉
10+
- **Total codebase:** ~10,000 lines across modular components
1111
- **Binary size:** ~300KB (editor), ~316KB (REPL)
12-
- **Module count:** 11 separate modules (buffers, undo, modal, search, markdown, etc.)
12+
- **Module count:** 12 separate modules (syntax, buffers, undo, modal, search, markdown, etc.)
1313

14-
**Recently Completed (v0.4.x):**
14+
**Recently Completed (v0.4.8):**
1515

16+
-**Syntax highlighting extraction** - Moved to dedicated `loki_syntax.c` module (291 lines)
1617
- ✅ Undo/Redo system with circular buffer
1718
- ✅ Multiple buffers (tabs) with Ctrl-T/Ctrl-W navigation
1819
- ✅ Modal editing with vim-like motions (hjkl, word motions, visual mode)
@@ -22,16 +23,35 @@ This roadmap outlines future development for Loki, organized around the **modula
2223
- ✅ Dynamic language registration system
2324
- ✅ Advanced Lua scripting with modular configuration
2425

26+
**Architectural Milestone:**
27+
28+
The syntax highlighting extraction brings `loki_core.c` below 900 lines (891 lines), achieving a **22.6% reduction** from the previous 1,152 lines. This is the **first time the core has been below 1,000 lines**, demonstrating the success of the modular architecture strategy.
29+
2530
## Philosophy
2631

2732
**Modular Architecture Principle:**
2833

29-
- Core remains focused on essential editor infrastructure (< 1,500 lines)
34+
- Core remains focused on essential editor infrastructure (**now < 900 lines!**)
3035
- Features implemented as separate, composable modules
3136
- Each module has single, well-defined responsibility
3237
- Clear API boundaries between components
3338
- Testable in isolation with zero tolerance for test failures
3439

40+
**Current Module Breakdown:**
41+
42+
1. **`loki_core.c`** (891 lines) - Terminal I/O, buffer management, file I/O, rendering
43+
2. **`loki_syntax.c`** (291 lines) - Syntax highlighting and color formatting
44+
3. **`loki_languages.c`** (494 lines) - Language definitions and markdown highlighting
45+
4. **`loki_buffers.c`** (426 lines) - Multiple buffer (tab) management
46+
5. **`loki_undo.c`** (474 lines) - Undo/redo with circular buffer
47+
6. **`loki_modal.c`** (510 lines) - Vim-like modal editing
48+
7. **`loki_selection.c`** (156 lines) - Text selection and OSC 52 clipboard
49+
8. **`loki_search.c`** (128 lines) - Incremental search
50+
9. **`loki_command.c`** (491 lines) - Ex-mode command system
51+
10. **`loki_terminal.c`** (125 lines) - Terminal control and window size
52+
11. **`loki_markdown.c`** (421 lines) - CommonMark parsing and rendering
53+
12. **`loki_lua.c`** (1,400+ lines) - Lua integration and API bindings
54+
3555
**Module Design Guidelines:**
3656

3757
- Self-contained with minimal coupling
@@ -149,6 +169,33 @@ int config_load_file(const char *path);
149169
150170
### Completed Features (v0.4.x)
151171
172+
#### ✅ Syntax Highlighting Module (`loki_syntax.c`)
173+
174+
**Status:** Completed in v0.4.8
175+
176+
- Extracted all syntax highlighting logic from `loki_core.c`
177+
- **Core reduction:** 1,152 → 891 lines (22.6% reduction, 261 lines removed)
178+
- 7 functions with consistent `syntax_*` naming:
179+
- `syntax_is_separator()` - Character separator detection
180+
- `syntax_row_has_open_comment()` - Multi-line comment state tracking
181+
- `syntax_name_to_code()` - String to HL_* constant mapping
182+
- `syntax_update_row()` - Main syntax highlighting logic
183+
- `syntax_format_color()` - RGB color escape sequence formatting
184+
- `syntax_select_for_filename()` - File extension to syntax mapping
185+
- `syntax_init_default_colors()` - Default color initialization
186+
- Supports all existing languages (C, Python, Lua, Markdown, etc.)
187+
- Supports dynamic language registration via Lua
188+
- True color (24-bit RGB) rendering
189+
- ~290 lines in dedicated module
190+
191+
**Benefits:**
192+
- Clean separation: syntax is a feature, not core infrastructure
193+
- Extensible: Future enhancements (tree-sitter, LSP) stay in module
194+
- Testable: Isolated unit testing possible
195+
- Optional: Can be compiled out for minimal builds
196+
197+
---
198+
152199
#### ✅ Undo/Redo Module (`loki_undo.c`)
153200
154201
**Status:** Completed in v0.4.x

0 commit comments

Comments
 (0)