static void handle_aardvark(void) {
state_set_aardvark_mode(!state_get_aardvark_mode());
+ state_set_screen_dirty(true);
}
static void handle_quit(void) {
}
static void handle_next(void) {
- workdir_next(state_get_focused_frame()->workdir);
+ //workdir_next(state_get_focused_frame()->workdir);
}
static void handle_prev(void) {
- workdir_prev(state_get_focused_frame()->workdir);
+ //workdir_prev(state_get_focused_frame()->workdir);
}
static void handle_cd(void) {
- workdir_cd(state_get_focused_frame()->workdir);
+ //workdir_cd(state_get_focused_frame()->workdir);
}
static binding_t Default_Bindings[] = {
more_matches = true;
}
/* If the current string matches exactly then execute it's handler */
- else if (0 == strcmp(Key_Buffer, seq))
+ if (0 == strcmp(Key_Buffer, seq))
{
binding.callback();
Key_Buffer[0] = '\0';
void screen_init(void) {
Screen_List = list_new();
list_push_back(Screen_List, screen_frame_new());
- Focused_Frame = master_frame();
+ //Focused_Frame = master_frame();
}
void screen_deinit(void) {
void screen_open(void) {
list_push_back(Screen_List, screen_frame_new());
+ state_set_screen_dirty(true);
}
void screen_close(void) {
int num_frames = list_size(Screen_List);
if(num_frames > 1){
list_delete(Screen_List, 0);
- Focused_Frame = master_frame();
+ //Focused_Frame = master_frame();
}
+ state_set_screen_dirty(true);
}
static void screen_place_windows(void) {
mvwin(p_frame->p_win, 0, 0);
wresize(p_frame->p_win, lines, (num_frames > 1) ? cols/2 : cols);
wclear(p_frame->p_win);
- screen_frame_draw_files(p_frame);
+ //screen_frame_draw_files(p_frame);
box(p_frame->p_win, 0 , 0);
wrefresh(p_frame->p_win);
mvwin(p_frame->p_win, pos, cols/2);
wresize(p_frame->p_win, height, cols/2);
wclear(p_frame->p_win);
- screen_frame_draw_files(p_frame);
+ //screen_frame_draw_files(p_frame);
wmove(p_frame->p_win, 1, 1);
box(p_frame->p_win, 0 , 0);
wrefresh(p_frame->p_win);
static frame_t* screen_frame_new(void) {
frame_t* p_frame = (frame_t*)mem_allocate(sizeof(frame_t),&screen_frame_free);
p_frame->p_win = newwin(1, 1, 0, 0);
- char* path = Focused_Frame->workdir->path;
- p_frame->workdir = workdir_new(path);
+ //char* path = Focused_Frame->workdir->path;
+ //p_frame->workdir = workdir_new(".");
return p_frame;
}
static void screen_frame_free(void* p_frame_ptr) {
frame_t* p_frame = (frame_t*)p_frame_ptr;
+ wclear(p_frame->p_win);
wborder(p_frame->p_win, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
wrefresh(p_frame->p_win);
delwin(p_frame->p_win);
- if(p_frame->workdir) mem_release(p_frame->workdir);
+ //if(p_frame->workdir) mem_release(p_frame->workdir);
}
void screen_frame_draw_files(frame_t* frame){
wattroff(frame->p_win, A_UNDERLINE);
//list files
while (i < vec_size(frame->workdir->vfiles)){
- if(frame == Focused_Frame && i == frame->workdir->idx){
- wattron(frame->p_win, A_STANDOUT);
- wattron(frame->p_win, A_BOLD);
- }
+ //if(frame == Focused_Frame && i == frame->workdir->idx){
+ // wattron(frame->p_win, A_STANDOUT);
+ // wattron(frame->p_win, A_BOLD);
+ //}
mvwaddnstr(frame->p_win, FrameTopBuffer+i-frame->workdir->top_index, 1, vec_at(frame->workdir->vfiles, i), cols-2);
- if(frame == Focused_Frame && i == frame->workdir->idx){
- wattroff(frame->p_win, A_STANDOUT);
- wattroff(frame->p_win, A_BOLD);
- }
+ //if(frame == Focused_Frame && i == frame->workdir->idx){
+ // wattroff(frame->p_win, A_STANDOUT);
+ // wattroff(frame->p_win, A_BOLD);
+ //}
i++;
if((FrameTopBuffer+i-frame->workdir->top_index+FrameBotBuffer) > rows) break;
}