]> git.mdlowis.com Git - archive/afm.git/commitdiff
fix highlighting artifacts
authora bellenir <a@bellenir.com>
Tue, 29 Jul 2014 20:54:03 +0000 (20:54 +0000)
committera bellenir <a@bellenir.com>
Tue, 29 Jul 2014 20:54:03 +0000 (20:54 +0000)
source/frame.c

index 9b621f582295e882cf826ac12cbe3823214f205f..f1a1670ee26e0225a7aa8000018d51a05b28a68b 100644 (file)
@@ -119,12 +119,16 @@ void frame_draw_files(Frame_T* frame){
 
 void frame_set_highlighting(Frame_T* frame, bool highlight, bool refresh_win){
        if(frame){
+               int rows,cols;
                int line = FrameTopBuffer + count_double_lines_to_idx(frame, false) + frame->workdir->idx - frame->top_index;
                attr_t newattr= highlight ? (A_STANDOUT|A_BOLD) : A_NORMAL;
                File_T* file = (File_T*) vec_at(frame->workdir->vfiles, frame->workdir->idx);
                short color = (file && is_dir(file->path) ? DIRECTORY : 0);
-               mvwchgat(frame->p_win, line, 0, -1, newattr, color, NULL);
-               if(file && file->expanded) mvwchgat(frame->p_win, line+1, color, -1, newattr, 0, NULL);
+               getmaxyx(frame->p_win, rows, cols);
+               (void) rows;
+               mvwchgat(frame->p_win, line, 1, cols-2, newattr, color, NULL);
+               if(file && file->expanded) mvwchgat(frame->p_win, line+1, 1, cols-2, newattr, color, NULL);
+               wmove(frame->p_win, 0, 0); //move the cursor out of the way
                if(frame_scroll(frame)) state_set_screen_dirty(true);
                if(refresh_win) wrefresh(frame->p_win);
        }