refactor
This commit is contained in:
parent
8ecb30a867
commit
6ee92025a0
1 changed files with 12 additions and 12 deletions
24
ccc.c
24
ccc.c
|
@ -16,6 +16,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
/* functions' definitions */
|
/* functions' definitions */
|
||||||
|
void start_ccc();
|
||||||
void change_dir(const char *buf, int selection);
|
void change_dir(const char *buf, int selection);
|
||||||
int mkdir_p(const char *destdir);
|
int mkdir_p(const char *destdir);
|
||||||
void populate_files(const char *path, int ftype);
|
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(7, COLOR_CYAN, -1); /* MARKED FILES */
|
||||||
init_pair(8, COLOR_WHITE, -1); /* REG */
|
init_pair(8, COLOR_WHITE, -1); /* REG */
|
||||||
|
|
||||||
half_width = COLS / 2;
|
|
||||||
init_windows();
|
|
||||||
refresh();
|
|
||||||
|
|
||||||
cwd = memalloc(PATH_MAX * sizeof(char));
|
cwd = memalloc(PATH_MAX * sizeof(char));
|
||||||
getcwd(cwd, PATH_MAX);
|
getcwd(cwd, PATH_MAX);
|
||||||
|
start_ccc();
|
||||||
populate_files(cwd, 0);
|
|
||||||
highlight_current_line();
|
|
||||||
|
|
||||||
int ch, ch2;
|
int ch, ch2;
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -298,11 +293,7 @@ int main(int argc, char** argv)
|
||||||
delwin(preview_content);
|
delwin(preview_content);
|
||||||
delwin(panel);
|
delwin(panel);
|
||||||
endwin();
|
endwin();
|
||||||
half_width = COLS / 2;
|
start_ccc();
|
||||||
init_windows();
|
|
||||||
refresh();
|
|
||||||
populate_files(cwd, 0);
|
|
||||||
highlight_current_line();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -314,6 +305,15 @@ int main(int argc, char** argv)
|
||||||
return 0;
|
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
|
* Change directory in window with selection
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue