From a3147570114ca252975ce9b0175ddc98509e1512 Mon Sep 17 00:00:00 2001 From: night0721 Date: Tue, 12 Nov 2024 02:43:08 +0000 Subject: [PATCH] Remove unnecessary lines and fix comment render without italic --- vip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vip.c b/vip.c index 7123cda..9465b3a 100644 --- a/vip.c +++ b/vip.c @@ -601,7 +601,6 @@ void draw_rows(void) case MLCOMMENT: bprintf("\033[3m"); bprintf(OVERLAY_2_BG); - bprintf("\033[23m"); break; case KW: @@ -634,6 +633,9 @@ void draw_rows(void) bprintf(WHITE_BG); } bprintf("%c", c[j]); + if (hl[j] == COMMENT || hl[j] == MLCOMMENT) { + bprintf("\033[23m"); + } } } bprintf(WHITE_BG); @@ -648,9 +650,7 @@ void update_row(row_t *row) int tabs = 0; for (int j = 0; j < row->size; j++) if (row->chars[j] == '\t') tabs++; - if (row->render) { - free(row->render); - } + free(row->render); row->render = malloc(row->size + tabs * (TAB_SIZE - 1) + 1); int idx = 0; for (int j = 0; j < row->size; j++) {