Skip to content

Commit

Permalink
adding my name :)
Browse files Browse the repository at this point in the history
  • Loading branch information
fr3nd committed Feb 10, 2018
1 parent 98645ea commit 7af5706
Showing 1 changed file with 25 additions and 14 deletions.
39 changes: 25 additions & 14 deletions src/vi.c
Expand Up @@ -754,31 +754,42 @@ void editorScroll() {
}

void editorDrawRows(struct abuf *ab) {
int y;
int y, n;
int len;
char welcome[80];
int welcomelen;
int padding;
int filerow;

n = 0;
for (y = 0; y < E.screenrows; y++) {
filerow = y + E.rowoff;
if (filerow >= E.numrows) {
if (E.numrows == 0 && y == E.screenrows / 3) {

sprintf(welcome, "MSX vi -- version %s", MSXVI_VERSION);
welcomelen = strlen(welcome);

padding = (E.screencols - welcomelen) / 2;

if (padding) {
if (E.numrows == 0) {
if (y >= E.screenrows / 3 && y <= E.screenrows / 3 + 1) {
switch (n) {
case 0:
sprintf(welcome, "MSX vi -- version %s", MSXVI_VERSION);
welcomelen = strlen(welcome);
break;
case 1:
sprintf(welcome, "by Carles Amigo (fr3nd)");
welcomelen = strlen(welcome);
break;
}

n++;
padding = (E.screencols - welcomelen) / 2;

if (padding) {
abAppend(ab, "~", 1);
padding--;
}
while (padding--) abAppend(ab, " ", 1);
abAppend(ab, welcome, welcomelen);
} else {
abAppend(ab, "~", 1);
padding--;
}
while (padding--) abAppend(ab, " ", 1);
abAppend(ab, welcome, welcomelen);
} else {
abAppend(ab, "~", 1);
}
} else {
len = E.row[filerow].rsize - E.coloff;
Expand Down

0 comments on commit 7af5706

Please sign in to comment.