From ef99f012a59df92660ec8c35f1d79609b6a0d833 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 12 Jun 2017 19:02:38 -0400 Subject: [PATCH] made current line marker more visible and adjusted it to highlight current screen line even on wrapped lines --- config.h | 11 ++++++----- lib/win.c | 12 +++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/config.h b/config.h index 5f4ec4c..a4d6544 100644 --- a/config.h +++ b/config.h @@ -81,9 +81,6 @@ unsigned int ColorPalette[16] = { }; #define COLOR_PAIR(bg, fg) (((bg) << 8) | (fg)) -int CLR_NormalText = COLOR_PAIR(0,4); -int CLR_GutterText = COLOR_PAIR(0,3); -int CLR_SelectedText = COLOR_PAIR(4,0); int CLR_TagsBkg = 1; // Background color for the tags region int CLR_EditBkg = 0; // Background color for the edit region int CLR_ScrollBkg = 3; // Background color for the scroll region @@ -93,8 +90,12 @@ int CLR_VerBorder = 2; // Vertical border color int CLR_Ruler = 1; // Ruler color int CLR_Cursor = 7; // Cursor color -int CLR_CurrentLine = 13; // Current Line Number -int CLR_Comment = 2; // Comment color +/* Text Color Attributes BG, FG */ +int CLR_NormalText = COLOR_PAIR( 0, 4 ); +int CLR_SelectedText = COLOR_PAIR( 4, 0 ); +int CLR_GutterText = COLOR_PAIR( 0, 3 ); +int CLR_CurrentLine = COLOR_PAIR( 11, 7 ); // Current Line Number +int CLR_Comment = COLOR_PAIR( 0, 2 ); // Comment color #undef INCLUDE_DEFS #endif diff --git a/lib/win.c b/lib/win.c index 7f078fb..977139d 100644 --- a/lib/win.c +++ b/lib/win.c @@ -236,13 +236,11 @@ static void onredraw(int width, int height) { size_t gcols = gutter_cols(); for (size_t line = 0, y = 0; y < view->nrows; y++) { Row* row = view_getrow(view, y); - if (line != row->line) - draw_line_num( - (y == Regions[i].csry), - Regions[i].x - (gcols * fwidth) - 5, - Regions[i].y + ((y+1) * fheight), - gcols, - row->line); + draw_line_num( (y == Regions[i].csry), + Regions[i].x - (gcols * fwidth) - 5, + Regions[i].y + ((y+1) * fheight), + gcols, + (line != row->line ? row->line : 0) ); draw_glyphs(Regions[i].x, Regions[i].y + ((y+1) * fheight), row->cols, row->rlen, row->len); line = row->line; } -- 2.49.0