1
0
mirror of https://gittea.dev/nova/th.git synced 2025-10-21 10:20:15 -04:00

addded select_all

This commit is contained in:
nova
2025-09-29 19:29:31 +02:00
parent 36012b1a71
commit 8839f737c5
3 changed files with 12 additions and 0 deletions

View File

@@ -44,6 +44,7 @@ static const binding key_binding[] = {
/* blackmagic holds a modifier of an action, either as string or as function pointer depending on the action */
{ "q", quit_program, NULL, "quit" },
{ " ", toggle_selection, NULL, "toggle file selection" }, /* on hovered file/directory */
{ "v", select_all, NULL, "select all files in dir" },
{ "e", update, NULL, "rerun all backend" }, /* executes the entire backend and redrawing of the screen */
{ "B", enter_shell, "$SHELL", "enter $SHELL shell" },
{ "/", search, NULL, "search" },

View File

@@ -194,6 +194,16 @@ void toggle_selection(){
pthread_mutex_unlock(&mutex_mid);
pthread_mutex_unlock(&mutex_selection);
}
void select_all(){
pthread_mutex_lock(&mutex_selection);
pthread_mutex_lock(&mutex_mid);
unsigned long i;
for(i = 0; i < mid_file_count; i++) {
mid_content[i].status ^= FILE_STATUS_SELECTED;
}
pthread_mutex_unlock(&mutex_mid);
pthread_mutex_unlock(&mutex_selection);
}
void move_down(int passes){
pthread_mutex_lock(&mutex_selection);
if (passes == 0) {

View File

@@ -7,6 +7,7 @@
void user_interactions();
void quit_program();
void toggle_selection();
void select_all();
void move_right();
void move_up(int passes);
void move_down(int passes);