Fix Top and Bot detection
This commit is contained in:
parent
ef4e93abb9
commit
e90877d2ac
1 changed files with 2 additions and 2 deletions
4
vip.c
4
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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue