tChange status styling and make sure location percentage is positive - ve - a minimal text editor (work in progress) (HTM) git clone git://src.adamsgaard.dk/ve (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 6652c9e2828ed13a56d577d091a2bb2ba174da83 (DIR) parent da50d333219b36039f8cde3175865d3db0212f05 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Tue, 6 Aug 2019 14:43:42 +0200 Change status styling and make sure location percentage is positive Diffstat: M output.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- (DIR) diff --git a/output.c b/output.c t@@ -38,11 +38,11 @@ editor_draw_status(struct abuf *ab) switch (E.mode) { case 1: left_status_len = snprintf(left_status, sizeof(left_status), - "INSERT "); + "INSERT > "); break; case 2: left_status_len = snprintf(left_status, sizeof(left_status), - "VISUAL "); + "VISUAL > "); break; } left_status_len += snprintf(left_status + left_status_len, t@@ -50,8 +50,8 @@ editor_draw_status(struct abuf *ab) E.filename ? E.filename : "[unnamed] "); right_status_len = snprintf(right_status, sizeof(right_status), - "%.0f%% < %d:%d", - (float)(E.cursor_y)/(E.num_rows-1)*100, + "%d%% < %d:%d", + abs((int)((float)(E.cursor_y)/(E.num_rows-1)*100)), E.cursor_x+1, E.cursor_y+1); if (left_status_len > E.screen_columns)