This commit is contained in:
Night Kaly 2024-03-20 12:28:08 +00:00
parent 8ecb30a867
commit 6ee92025a0
No known key found for this signature in database
GPG key ID: 8E829D3381CFEBBE

24
ccc.c
View file

@ -16,6 +16,7 @@
#include "config.h"
/* functions' definitions */
void start_ccc();
void change_dir(const char *buf, int selection);
int mkdir_p(const char *destdir);
void populate_files(const char *path, int ftype);
@ -80,15 +81,9 @@ int main(int argc, char** argv)
init_pair(7, COLOR_CYAN, -1); /* MARKED FILES */
init_pair(8, COLOR_WHITE, -1); /* REG */
half_width = COLS / 2;
init_windows();
refresh();
cwd = memalloc(PATH_MAX * sizeof(char));
getcwd(cwd, PATH_MAX);
populate_files(cwd, 0);
highlight_current_line();
start_ccc();
int ch, ch2;
while (1) {
@ -298,11 +293,7 @@ int main(int argc, char** argv)
delwin(preview_content);
delwin(panel);
endwin();
half_width = COLS / 2;
init_windows();
refresh();
populate_files(cwd, 0);
highlight_current_line();
start_ccc();
break;
default:
break;
@ -314,6 +305,15 @@ int main(int argc, char** argv)
return 0;
}
void start_ccc()
{
half_width = COLS / 2;
init_windows();
refresh();
populate_files(cwd, 0);
highlight_current_line();
}
/*
* Change directory in window with selection
*/