new canvas library changed client for compatibility

This commit is contained in:
Priec
2025-07-30 22:42:32 +02:00
parent ad82bd4302
commit cc19c61f37
4 changed files with 83 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
// src/state/pages/add_logic.rs
use crate::config::binds::config::{EditorConfig, EditorKeybindingMode};
use canvas::canvas::{CanvasState, ActionContext, CanvasAction}; // External library
use canvas::canvas::{CanvasState, ActionContext, CanvasAction, AppMode};
use crate::components::common::text_editor::{TextEditor, VimState};
use std::cell::RefCell;
use std::rc::Rc;
@@ -54,6 +54,7 @@ pub struct AddLogicState {
// New fields for same-profile table names and column autocomplete
pub same_profile_table_names: Vec<String>, // Tables from same profile only
pub script_editor_awaiting_column_autocomplete: Option<String>, // Table name waiting for column fetch
pub app_mode: AppMode,
}
impl AddLogicState {
@@ -91,6 +92,7 @@ impl AddLogicState {
same_profile_table_names: Vec::new(),
script_editor_awaiting_column_autocomplete: None,
app_mode: AppMode::Edit,
}
}
@@ -269,7 +271,9 @@ impl AddLogicState {
impl Default for AddLogicState {
fn default() -> Self {
Self::new(&EditorConfig::default())
let mut state = Self::new(&EditorConfig::default());
state.app_mode = AppMode::Edit;
state
}
}
@@ -439,4 +443,8 @@ impl CanvasState for AddLogicState {
_ => None,
}
}
fn current_mode(&self) -> AppMode {
self.app_mode
}
}