|
|
@@ -6,6 +6,12 @@
|
|
|
#include "lumacs/minibuffer_manager.hpp" // Include for MinibufferManager and MinibufferMode
|
|
|
#include "lumacs/gtk_renderer.hpp" // Include for GtkRenderer
|
|
|
#include "lumacs/gtk_completion_popup.hpp" // Include for GtkCompletionPopup
|
|
|
+#include "lumacs/buffer_manager.hpp" // Include for BufferManager
|
|
|
+#include "lumacs/window_manager.hpp" // Include for WindowManager
|
|
|
+#include "lumacs/kill_ring_manager.hpp" // Include for KillRingManager
|
|
|
+#include "lumacs/register_manager.hpp" // Include for RegisterManager
|
|
|
+#include "lumacs/macro_manager.hpp" // Include for MacroManager
|
|
|
+#include "lumacs/rectangle_manager.hpp" // Include for RectangleManager
|
|
|
#include <iostream>
|
|
|
#include <filesystem>
|
|
|
#include <vector>
|
|
|
@@ -98,7 +104,7 @@ void GtkEditor::handle_editor_event(EditorEvent event) {
|
|
|
core_->minibuffer_manager().activate_minibuffer(
|
|
|
MinibufferMode::FilePath, "Find file: ",
|
|
|
[this](const std::string& input) {
|
|
|
- if (core_->load_file(input)) core_->set_message("Loaded");
|
|
|
+ if (core_->buffer_manager().load_file(input)) core_->set_message("Loaded");
|
|
|
else core_->set_message("Failed to load");
|
|
|
}, nullptr
|
|
|
);
|
|
|
@@ -107,7 +113,7 @@ void GtkEditor::handle_editor_event(EditorEvent event) {
|
|
|
core_->minibuffer_manager().activate_minibuffer(
|
|
|
MinibufferMode::BufferName, "Switch to buffer: ",
|
|
|
[this](const std::string& input) {
|
|
|
- if (core_->switch_buffer_in_window(input)) core_->set_message("Switched");
|
|
|
+ if (core_->buffer_manager().switch_buffer_in_window(input)) core_->set_message("Switched");
|
|
|
else core_->set_message("Buffer not found");
|
|
|
}, nullptr
|
|
|
);
|
|
|
@@ -116,7 +122,7 @@ void GtkEditor::handle_editor_event(EditorEvent event) {
|
|
|
core_->minibuffer_manager().activate_minibuffer(
|
|
|
MinibufferMode::BufferName, "Kill buffer: ",
|
|
|
[this](const std::string& input) {
|
|
|
- if (core_->close_buffer(input)) core_->set_message("Killed buffer");
|
|
|
+ if (core_->buffer_manager().close_buffer(input)) core_->set_message("Killed buffer");
|
|
|
else core_->set_message("Buffer not found");
|
|
|
}, nullptr
|
|
|
);
|
|
|
@@ -128,7 +134,7 @@ void GtkEditor::handle_editor_event(EditorEvent event) {
|
|
|
auto theme_names = core_->theme_manager().theme_names();
|
|
|
auto it = std::find(theme_names.begin(), theme_names.end(), input);
|
|
|
if (it != theme_names.end()) {
|
|
|
- core_->set_theme(input);
|
|
|
+ core_->theme_manager().set_active_theme(input);
|
|
|
core_->set_message("Switched to theme: " + input);
|
|
|
} else {
|
|
|
core_->set_message("Theme not found: " + input);
|
|
|
@@ -301,7 +307,7 @@ bool GtkEditor::on_global_key_pressed(guint keyval, guint keycode, Gdk::Modifier
|
|
|
queue_redraw_all_windows(content_widget_); // Redraw minibuffer content
|
|
|
} else {
|
|
|
// If minibuffer didn't handle it, it could be a keybinding for the editor that
|
|
|
- // should still work while the minibuffer is active (e.g., C-g for quit)
|
|
|
+ // should still work while the minibuffer is active (e.g., C-g for quit).
|
|
|
// For now, we assume if minibuffer is active, it consumes all relevant keys.
|
|
|
// If the key is not handled, it probably means it's irrelevant to minibuffer input.
|
|
|
// But we should still consume it to avoid propagating to editor keybindings accidentally.
|
|
|
@@ -464,7 +470,7 @@ Gtk::Widget* GtkEditor::create_widget_for_layout_node(std::shared_ptr<LayoutNode
|
|
|
if (auto window = weak_window_click.lock()) {
|
|
|
// 1. Activate Window
|
|
|
if (core_ && core_->active_window() != window) {
|
|
|
- core_->set_active_window(window);
|
|
|
+ core_->window_manager().set_active_window(window);
|
|
|
cached_active_window_ = window; // Cache for rendering to prevent focus jumping
|
|
|
}
|
|
|
// IMPORTANT: Grab keyboard focus for this widget
|