vim or default mode workin properly now

This commit is contained in:
filipriec
2025-05-24 19:25:35 +02:00
parent 7229e2abbd
commit 82e96f7b86
3 changed files with 9 additions and 21 deletions

View File

@@ -85,8 +85,6 @@ revert = ["r"]
[editor]
keybinding_mode = "vim" # Options: "default", "vim", "emacs"
show_line_numbers = true
tab_width = 4
[colors]
theme = "dark"

View File

@@ -19,7 +19,7 @@ pub enum EditorKeybindingMode {
impl Default for EditorKeybindingMode {
fn default() -> Self {
EditorKeybindingMode::Vim // Or EditorKeybindingMode::Default
EditorKeybindingMode::Default
}
}

View File

@@ -181,6 +181,7 @@ pub fn handle_admin_navigation(
}
}
// In src/functions/modes/navigation/admin_nav.rs
AdminFocus::Button1 => { // Add Logic
let mut logic_state_profile_name = "None (Global)".to_string();
let mut selected_table_id: Option<i64> = None;
@@ -207,27 +208,16 @@ pub fn handle_admin_navigation(
// Keep logic_state_profile_name as "None (Global)"
}
// Create AddLogicState with the loaded config
admin_state.add_logic_state = AddLogicState {
profile_name: logic_state_profile_name.clone(),
editor_keybinding_mode: config.editor.keybinding_mode.clone(), // Add this line
..AddLogicState::default()
};
buffer_state.update_history(AppView::AddLogic);
app_state.ui.focus_outside_canvas = false;
// Command message might be overwritten if profile selection had an issue,
// 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
);
}
// Rest of the code remains the same...
}
AdminFocus::Button2 => {
if let Some(p_idx) = admin_state.selected_profile_index {