Эх сурвалжийг харах

updating architecture and readmen files

Bernardo Magri 1 сар өмнө
parent
commit
d505891c13
2 өөрчлөгдсөн 33 нэмэгдсэн , 35 устгасан
  1. 22 30
      README.md
  2. 11 5
      documentation/ARCHITECTURE.md

+ 22 - 30
README.md

@@ -8,9 +8,9 @@ A modern, highly customizable text editor engine written in C++20, deeply inspir
 
 Lumacs aims to provide a rich, Emacs-like editing experience with a focus on configurability and modern C++ practices.
 
-### ✅ Implemented Features (Functional, some require refactoring)
+### ✅ Implemented Features
 
-The editor currently boasts a wide array of functional features, though ongoing refactoring efforts (detailed in the [Development Plan](documentation/PLAN.md)) aim to enhance their modularity, maintainability, and extensibility.
+The editor currently boasts a wide array of functional features, as detailed in the [Development Plan](documentation/PLAN.md).
 
 -   **Core Emacs Editing DNA**:
     *   **Buffer Management**: Robust handling of multiple buffers, including switching, listing, and closing.
@@ -20,41 +20,30 @@ The editor currently boasts a wide array of functional features, though ongoing
     *   **Rectangles**: Comprehensive operations for killing, yanking, and manipulating rectangular blocks of text.
     *   **Text Editing**: Basic insertion, deletion, and replacement, handling multi-line scenarios and buffer events.
     *   **Undo/Redo**: Functionality for reverting and re-applying changes.
-    *   **Window Splits**: Dynamic horizontal and vertical window splitting, closing, and navigation, with robust layout management and focus handling in the GTK frontend.
-    *   **Input System**: Functional keyboard input handling across GTK and TUI, including modifiers.
-    *   **Cursor System**: UI-agnostic cursor position/movement logic, with blinking, inverted block cursor rendering in GTK.
-    *   **Scrolling System**: Full vertical and horizontal scrolling with auto-adjustment to keep the cursor in view, supporting page-up/down.
+    *   **Window Splits**: Dynamic horizontal and vertical window splitting, closing, and navigation.
+    *   **Input System**: Functional keyboard input handling across GTK and TUI.
+    *   **Cursor System**: UI-agnostic cursor position/movement logic.
+    *   **Scrolling System**: Full vertical and horizontal scrolling with auto-adjustment.
 
 -   **Advanced UI & System Integration**:
-    *   **Theme System**: A robust and flexible theming engine with 6 professional themes (Dracula, Everforest, Nord, Solarized, Gruvbox, Default). Supports named faces, inheritance, minibuffer selection with fuzzy completion, and a comprehensive Lua API for customization.
-    *   **Minibuffer & Command System**: A functional interactive minibuffer with tab completion, history navigation, and command execution. A comprehensive C++ command registry with fuzzy matching and a powerful Lua API for command registration and execution are in place.
+    *   **Theme System**: A robust and flexible theming engine with 6 professional themes (Dracula, Everforest, Nord, Solarized, Gruvbox, Default).
+    *   **Minibuffer & Command System**: A functional interactive minibuffer with tab completion, history navigation, and command execution.
     *   **Syntax Highlighting**: Pango-based text rendering with syntax highlighting based on a face system.
-    *   **Text-Cursor Alignment**: Precise Pango-based text measurement ensures accurate cursor alignment.
-    *   **Clean Exit**: Robust application shutdown, including proper GTK resource cleanup.
-    *   **Modeline**: Modular and extensible status bar with UI-agnostic content generation, integrated into GTK rendering.
-    *   **GTK Frontend**: Primary GUI using GTK4 / gtkmm, supporting Pango/Cairo rendering.
+    *   **GTK Frontend**: Primary GUI using GTK4 / gtkmm, supporting Pango/Cairo rendering with caching.
     *   **Ncurses TUI**: Functional terminal user interface serving as a fallback.
+    *   **Modeline**: Modular and extensible status bar.
+    *   **Completion**: Advanced completion with popup support.
 
-### ⚠️ Partially Implemented / Needs Refactoring
+-   **Extensibility**:
+    *   **Lua Scripting**: Comprehensive Lua 5.4 API for extending and customizing the editor.
+    *   **Plugin Management**: Dynamic loading and lifecycle management of Lua plugins.
+    *   **Lua Debugging**: Integrated remote debugging support via MobDebug.
 
-Certain features, while present, are identified for significant refactoring to align with architectural goals and enhance robustness/extensibility.
+### 🔄 Planned Enhancements
 
--   **Keyboard Macros**: Recording functionality is implemented, but macro playback is currently a `TODO`.
--   **Minibuffer Logic**: While functional, the minibuffer's state management, completion logic, history, and command dispatch are highly coupled and duplicated across UI frontends. This requires centralization into a UI-agnostic `MinibufferManager`.
--   **Keybinding System**: Functional, but needs canonical key representation refinement, prefix lookup optimization (e.g., using a Trie), and tighter integration with the Command System to centralize execution.
--   **Command System**: The C++ registry is robust, but requires enhanced argument handling (e.g., `InteractiveSpec` for dynamic prompting, type-safe arguments), consolidation of command string parsing, and refined completion integration (externalizing specific completers).
--   **GTK Frontend (`GtkEditor`)**: The `GtkEditor` remains a "God Object" in some aspects. Decoupling rendering concerns into specialized components and moving C++ fallback keybindings to Lua are key refactoring targets.
--   **ThemeElement Usage**: The legacy `ThemeElement` enum is still present in some rendering logic and needs to be fully transitioned to the unified `Face` system.
-
-### 🔄 Planned Enhancements (Post-Refactoring)
-
-Once current refactoring efforts are complete, the following are planned:
-
--   **Advanced Completion UI**: Implement a popup completion window with descriptions and better visual feedback.
--   **Plugin Management**: Implement dynamic loading and lifecycle management of Lua plugins.
--   **Lua Debugging**: Integrate basic debugging support for Lua scripts.
--   **Command Aliases**: Allow users to define custom command aliases in their configuration.
 -   **Language Modes**: Expand support for various language modes (Python, C++, JavaScript).
+-   **Performance Optimization**: Further rendering optimizations for large files.
+-   **Testing**: Continued expansion of test coverage.
 
 ## Tech Stack
 
@@ -62,6 +51,8 @@ Once current refactoring efforts are complete, the following are planned:
 -   **UI**: GTK4 / gtkmm (GUI), Ncurses (TUI)
 -   **Scripting**: Lua 5.4 with `sol2` bindings
 -   **Build**: CMake 3.20+
+-   **Logging**: spdlog
+-   **Testing**: Google Test
 
 ## Quick Start
 
@@ -90,8 +81,9 @@ Common Emacs-like keybindings are supported. Refer to `init.lua` for the full de
 ## Documentation
 
 -   [Architecture Overview](documentation/ARCHITECTURE.md)
+-   [Lua API Reference](documentation/LUA_API.md)
 -   [Development Plan](documentation/PLAN.md)
 
 ## License
 
-MIT
+MIT

+ 11 - 5
documentation/ARCHITECTURE.md

@@ -21,6 +21,8 @@ graph TD
         Core -->|Delegate| WindowMgr[WindowManager]
         Core -->|Delegate| MinibufferMgr[MinibufferManager]
         Core -->|Delegate| MacroMgr[MacroManager]
+        Core -->|Delegate| PluginMgr[PluginManager]
+        Core -->|Delegate| ThemeMgr[ThemeManager]
     end
     
     BufferMgr -->|Manage| Buffer[Buffer]
@@ -38,8 +40,8 @@ graph TD
 ### 1. EditorCore (`editor_core.hpp`)
 The application root.
 - **Role**: Owner of all Manager subsystems.
-- **Interfaces**: Implements `IEditorNotifier` (events) and `IWindowManager` (layout access).
-- **State**: Holds the global editor configuration and theme manager.
+- **Interfaces**: Implements `IEditorNotifier` (events) and `IWindowManager` (layout access) and `ICommandTarget`.
+- **State**: Holds the global editor configuration and delegates functionality to managers.
 
 ### 2. Managers (The Logic Layer)
 Functionality is partitioned into specialized managers:
@@ -50,6 +52,10 @@ Functionality is partitioned into specialized managers:
 - **`MinibufferManager`**: Handles the command line / prompt area logic, including completion and interactive search (ISearch).
 - **`MacroManager`**: Records and plays back keyboard macros.
 - **`PluginManager`**: Discovers and loads Lua plugins.
+- **`ThemeManager`**: Manages color themes and face definitions.
+- **`KillRingManager`**: Manages the kill ring (clipboard history).
+- **`RegisterManager`**: Manages text registers.
+- **`RectangleManager`**: Handles rectangular edit operations.
 
 ### 3. Data Structures
 - **`Buffer`**: Stores text as a list of strings (Gap Buffer concept abstract). Manages syntax highlighting (`StyledRange`), undo/redo stack, and mark/region.
@@ -87,11 +93,11 @@ To avoid circular dependencies (e.g., `BufferManager` needing `EditorCore` needi
 1.  **Input**: User presses a key (e.g., `C-f`).
 2.  **Capture**: `GtkEditor` captures the event via `Gtk::EventControllerKey` (Phase: Capture).
 3.  **Normalization**: Key is converted to a string `"C-f"`.
-4.  **Processing**: Passed to `KeyBindingManager::process_key`.
+4.  **Processing**: Passed to `LuaApi::process_key` which delegates to `KeyBindingManager::process_key`.
 5.  **Resolution**: Trie traversal finds command `"forward-char"`.
 6.  **Recording**: If macro recording is active, `KeyBindingManager` notifies `MacroManager`.
 7.  **Execution**: `CommandSystem` executes the C++ lambda for `forward-char`.
-8.  **Update**: `EditorCore::move_right` modifies the `Window` cursor.
+8.  **Update**: `EditorCore` delegates to method (e.g., `move_right`), which updates the `Window` cursor.
 9.  **Notification**: `EditorCore` emits `EditorEvent::CursorMoved`.
 10. **Render**: `GtkEditor` receives event, queues redraw. `GtkRenderer` updates the screen.
 
@@ -113,4 +119,4 @@ To avoid circular dependencies (e.g., `BufferManager` needing `EditorCore` needi
     - `sol2` (Bindings)
     - `spdlog` (Logging)
     - `ncurses` (TUI)
-    - `gtest` (Testing)
+    - `gtest` (Testing)