fixed indent

This commit is contained in:
nova 2025-02-26 14:02:29 +01:00
parent 56bc1e4314
commit 13190d7ef8

102
window.c
View File

@ -73,73 +73,73 @@ void print_dir(WINDOW *win, unsigned long file_count, unsigned long longest_name
void window_main(WINDOW *win, unsigned int start_y, unsigned int start_x){
unsigned int local_width;
unsigned int local_height;
unsigned long file_count = 0;
unsigned long longest_name = 0;
unsigned int local_width;
unsigned int local_height;
unsigned long file_count = 0;
unsigned long longest_name = 0;
//{{{ size & positioning
wresize(win, terminal_height, terminal_width/3);
getmaxyx(win, local_height, local_width);
mvwin(win, start_y, start_x);
wclear(win);
//}}}
wmove(win, 1, 1);
wprintw(win, "meow");
get_dir_size(".", &file_count, &longest_name, 0);
char **dir_content;
dir_content = calloc(file_count, sizeof(*dir_content));
for (unsigned long i = 0; i<file_count; i++) {
dir_content[i] = calloc(longest_name, sizeof(*dir_content[i]));
}
//{{{ size & positioning
wresize(win, terminal_height, terminal_width/3);
getmaxyx(win, local_height, local_width);
mvwin(win, start_y, start_x);
wclear(win);
//}}}
wmove(win, 1, 1);
wprintw(win, "meow");
get_dir_size(".", &file_count, &longest_name, 0);
char **dir_content;
dir_content = calloc(file_count, sizeof(*dir_content));
for (unsigned long i = 0; i<file_count; i++) {
dir_content[i] = calloc(longest_name, sizeof(*dir_content[i]));
}
get_dir_content(".", file_count, longest_name, dir_content, 0);
print_dir(win, file_count, longest_name, dir_content);
get_dir_content(".", file_count, longest_name, dir_content, 0);
print_dir(win, file_count, longest_name, dir_content);
free(*dir_content);
free(*dir_content);
box(win,0,0);
wrefresh(win);
box(win,0,0);
wrefresh(win);
}
void window_left(WINDOW *win, unsigned int start_y, unsigned int start_x){
DIR *dir = opendir(".");
unsigned int local_width;
unsigned int local_height;
unsigned long file_count = 0;
unsigned long longest_name = 0;
DIR *dir = opendir(".");
unsigned int local_width;
unsigned int local_height;
unsigned long file_count = 0;
unsigned long longest_name = 0;
//{{{ size & positioning
wresize(win, terminal_height, terminal_width/3);
getmaxyx(win, local_height, local_width);
mvwin(win, start_y, start_x);
wclear(win);
//}}}
//{{{ size & positioning
wresize(win, terminal_height, terminal_width/3);
getmaxyx(win, local_height, local_width);
mvwin(win, start_y, start_x);
wclear(win);
//}}}
wmove(win, 0, 0);
wmove(win, 0, 0);
box(win,0,0);
wrefresh(win);
box(win,0,0);
wrefresh(win);
}
void window_right(WINDOW *win, unsigned int start_y, unsigned int start_x){
wmove(win, 0, 0);
unsigned int local_width;
unsigned int local_height;
wmove(win, 0, 0);
unsigned int local_width;
unsigned int local_height;
//{{{ size & positioning
wresize(win, terminal_height, terminal_width/3);
getmaxyx(win, local_height, local_width);
mvwin(win, start_y, start_x);
wclear(win);
//}}}
//{{{ size & positioning
wresize(win, terminal_height, terminal_width/3);
getmaxyx(win, local_height, local_width);
mvwin(win, start_y, start_x);
wclear(win);
//}}}
wmove(win, local_height/2, local_width/2);
wprintw(win, "%d,%d", local_height, local_width);
wmove(win, local_height/2, local_width/2);
wprintw(win, "%d,%d", local_height, local_width);
box(win,0,0);
wrefresh(win);
box(win,0,0);
wrefresh(win);
}