about summary refs log tree commit diff stats
path: root/src/kilo.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-13 22:00:50 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-13 22:00:50 -0800
commit485cd25739115047518f006a8f535b9c5e7dd043 (patch)
tree35c109f731cd7f93260c53c8337cd3be2302f0c2 /src/kilo.c
parenta7139a6b1462458487c8a416f521ceaf94aa604f (diff)
downloadteliva-485cd25739115047518f006a8f535b9c5e7dd043.tar.gz
fix for editor highlighting
Bug introduced during the transition to ncurses.
Diffstat (limited to 'src/kilo.c')
-rw-r--r--src/kilo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kilo.c b/src/kilo.c
index bd3bd60..801ba4b 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -655,8 +655,10 @@ extern void draw_menu_item(const char* key, const char* name);
 static void editorRefreshScreen(void) {
     int y;
     erow *r;
+    int current_color = -1;
     curs_set(0);
     clear();
+    attrset(A_NORMAL);
     for (y = 0; y < LINES-1; y++) {
         int filerow = E.rowoff+y;
 
@@ -667,7 +669,6 @@ static void editorRefreshScreen(void) {
         r = &E.row[filerow];
 
         int len = r->rsize - E.coloff;
-        int current_color = -1;
         mvaddstr(y, 0, "");
         if (len > 0) {
             if (len > COLS) len = COLS;