indexing now works amazingly well

This commit is contained in:
filipriec
2025-04-22 16:03:16 +02:00
parent b01ba0b2d9
commit ec596b2ada
4 changed files with 77 additions and 7 deletions

View File

@@ -203,7 +203,16 @@ pub fn handle_add_table_navigation(
AddTableFocus::InsideIndexesTable => {
// Select does nothing here anymore, only Esc exits.
if let Some(index) = add_table_state.index_table_state.selected() {
*command_message = format!("Selected index index {} (Press Esc to exit scroll mode)", index);
if let Some(idx_def) = add_table_state.indexes.get_mut(index) {
idx_def.selected = !idx_def.selected;
add_table_state.has_unsaved_changes = true;
*command_message = format!(
"Toggled selection for index: {} to {}",
idx_def.name, idx_def.selected
);
} else {
*command_message = "Error: Selected index out of bounds".to_string();
}
} else {
*command_message = "No index selected (Press Esc to exit scroll mode)".to_string();
}