From 0a5d7b10a6659981cd0a380e5dce214e203c3215 Mon Sep 17 00:00:00 2001 From: a bellenir Date: Tue, 29 Jul 2014 20:54:03 +0000 Subject: [PATCH] fix highlighting artifacts --- source/frame.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/frame.c b/source/frame.c index 9b621f5..f1a1670 100644 --- a/source/frame.c +++ b/source/frame.c @@ -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); } -- 2.54.0