From e90877d2ac80f0e3ca0453ce89c82387589ec065 Mon Sep 17 00:00:00 2001 From: night0721 Date: Tue, 12 Nov 2024 12:41:09 +0000 Subject: [PATCH] Fix Top and Bot detection --- vip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vip.c b/vip.c index e3bc020..f67dfc0 100644 --- a/vip.c +++ b/vip.c @@ -93,8 +93,8 @@ void draw_status_bar(void) strlen(cur_editor->filename) > 0 ? cur_editor->filename : "[No Name]", cur_editor->dirty ? "[+]" : ""); int info_len = snprintf(info, sizeof(info), " %s ", cur_editor->syntax ? cur_editor->syntax->filetype : ""); int lines_len; - if (cur_editor->rows == 0 || cur_editor->rows == cur_editor->y + 1) { - lines_len = snprintf(lines, sizeof(lines), " %s ", cur_editor->rows == 0 ? "Top" : "Bot"); + if (cur_editor->y == 0 || cur_editor->rows == cur_editor->y + 1) { + lines_len = snprintf(lines, sizeof(lines), " %s ", cur_editor->y == 0 ? "Top" : "Bot"); } else { lines_len = snprintf(lines, sizeof(lines), " %d%% ", ((cur_editor->y + 1) * 100 / cur_editor->rows)); }