vim or default mode workin properly now
This commit is contained in:
@@ -85,8 +85,6 @@ revert = ["r"]
|
|||||||
|
|
||||||
[editor]
|
[editor]
|
||||||
keybinding_mode = "vim" # Options: "default", "vim", "emacs"
|
keybinding_mode = "vim" # Options: "default", "vim", "emacs"
|
||||||
show_line_numbers = true
|
|
||||||
tab_width = 4
|
|
||||||
|
|
||||||
[colors]
|
[colors]
|
||||||
theme = "dark"
|
theme = "dark"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ pub enum EditorKeybindingMode {
|
|||||||
|
|
||||||
impl Default for EditorKeybindingMode {
|
impl Default for EditorKeybindingMode {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
EditorKeybindingMode::Vim // Or EditorKeybindingMode::Default
|
EditorKeybindingMode::Default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ pub fn handle_admin_navigation(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In src/functions/modes/navigation/admin_nav.rs
|
||||||
AdminFocus::Button1 => { // Add Logic
|
AdminFocus::Button1 => { // Add Logic
|
||||||
let mut logic_state_profile_name = "None (Global)".to_string();
|
let mut logic_state_profile_name = "None (Global)".to_string();
|
||||||
let mut selected_table_id: Option<i64> = None;
|
let mut selected_table_id: Option<i64> = None;
|
||||||
@@ -195,7 +196,7 @@ pub fn handle_admin_navigation(
|
|||||||
selected_table_name_for_logic = Some(table.name.clone());
|
selected_table_name_for_logic = Some(table.name.clone());
|
||||||
*command_message = format!("Adding logic for table: {}. CRITICAL: Table ID not found in profile tree response!", table.name);
|
*command_message = format!("Adding logic for table: {}. CRITICAL: Table ID not found in profile tree response!", table.name);
|
||||||
} else {
|
} else {
|
||||||
*command_message = format!("Selected table index {} out of bounds for profile '{}'. Logic will not be table-specific.", t_idx, profile.name);
|
*command_message = format!("Selected table index {} out of bounds for profile '{}'. Logic will not be table-specific.", t_idx, profile.name);
|
||||||
}} else {
|
}} else {
|
||||||
*command_message = format!("No table selected in profile '{}'. Logic will not be table-specific.", profile.name);
|
*command_message = format!("No table selected in profile '{}'. Logic will not be table-specific.", profile.name);
|
||||||
}
|
}
|
||||||
@@ -203,31 +204,20 @@ pub fn handle_admin_navigation(
|
|||||||
*command_message = "Error: Selected profile index out of bounds, associating with 'None'.".to_string();
|
*command_message = "Error: Selected profile index out of bounds, associating with 'None'.".to_string();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
*command_message = "No profile selected ([*]), associating Logic with 'None (Global)'.".to_string();
|
*command_message = "No profile selected ([*]), associating Logic with 'None (Global)'.".to_string();
|
||||||
// Keep logic_state_profile_name as "None (Global)"
|
// Keep logic_state_profile_name as "None (Global)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create AddLogicState with the loaded config
|
||||||
admin_state.add_logic_state = AddLogicState {
|
admin_state.add_logic_state = AddLogicState {
|
||||||
profile_name: logic_state_profile_name.clone(),
|
profile_name: logic_state_profile_name.clone(),
|
||||||
|
editor_keybinding_mode: config.editor.keybinding_mode.clone(), // Add this line
|
||||||
..AddLogicState::default()
|
..AddLogicState::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
buffer_state.update_history(AppView::AddLogic);
|
buffer_state.update_history(AppView::AddLogic);
|
||||||
app_state.ui.focus_outside_canvas = false;
|
app_state.ui.focus_outside_canvas = false;
|
||||||
// Command message might be overwritten if profile selection had an issue,
|
// Rest of the code remains the same...
|
||||||
// so set the navigation message last if no error.
|
|
||||||
if !command_message.starts_with("Error:") && !command_message.contains("associating Logic with 'None (Global)'") {
|
|
||||||
*command_message = format!(
|
|
||||||
"Navigating to Add Logic for profile '{}'...",
|
|
||||||
logic_state_profile_name
|
|
||||||
);
|
|
||||||
} else if command_message.contains("associating Logic with 'None (Global)'") {
|
|
||||||
// Append to existing message
|
|
||||||
let existing_msg = command_message.clone();
|
|
||||||
*command_message = format!(
|
|
||||||
"{} Navigating to Add Logic...",
|
|
||||||
existing_msg
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
AdminFocus::Button2 => {
|
AdminFocus::Button2 => {
|
||||||
if let Some(p_idx) = admin_state.selected_profile_index {
|
if let Some(p_idx) = admin_state.selected_profile_index {
|
||||||
|
|||||||
Reference in New Issue
Block a user