mirror of
https://gittea.dev/nova/th.git
synced 2025-10-22 02:40:15 -04:00
addded select_all
This commit is contained in:
1
config.h
1
config.h
@@ -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 */
|
/* blackmagic holds a modifier of an action, either as string or as function pointer depending on the action */
|
||||||
{ "q", quit_program, NULL, "quit" },
|
{ "q", quit_program, NULL, "quit" },
|
||||||
{ " ", toggle_selection, NULL, "toggle file selection" }, /* on hovered file/directory */
|
{ " ", 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 */
|
{ "e", update, NULL, "rerun all backend" }, /* executes the entire backend and redrawing of the screen */
|
||||||
{ "B", enter_shell, "$SHELL", "enter $SHELL shell" },
|
{ "B", enter_shell, "$SHELL", "enter $SHELL shell" },
|
||||||
{ "/", search, NULL, "search" },
|
{ "/", search, NULL, "search" },
|
||||||
|
@@ -194,6 +194,16 @@ void toggle_selection(){
|
|||||||
pthread_mutex_unlock(&mutex_mid);
|
pthread_mutex_unlock(&mutex_mid);
|
||||||
pthread_mutex_unlock(&mutex_selection);
|
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){
|
void move_down(int passes){
|
||||||
pthread_mutex_lock(&mutex_selection);
|
pthread_mutex_lock(&mutex_selection);
|
||||||
if (passes == 0) {
|
if (passes == 0) {
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
void user_interactions();
|
void user_interactions();
|
||||||
void quit_program();
|
void quit_program();
|
||||||
void toggle_selection();
|
void toggle_selection();
|
||||||
|
void select_all();
|
||||||
void move_right();
|
void move_right();
|
||||||
void move_up(int passes);
|
void move_up(int passes);
|
||||||
void move_down(int passes);
|
void move_down(int passes);
|
||||||
|
Reference in New Issue
Block a user