Make numbers red
This commit is contained in:
parent
1a24341130
commit
6f8ea7487b
1 changed files with 11 additions and 1 deletions
12
kilo.c
12
kilo.c
|
@ -537,7 +537,17 @@ void editorDrawRows(struct abuf *ab) {
|
||||||
int len = E.row[filerow].rsize - E.coloff;
|
int len = E.row[filerow].rsize - E.coloff;
|
||||||
if (len < 0) len = 0;
|
if (len < 0) len = 0;
|
||||||
if (len > E.screencols) len = E.screencols;
|
if (len > E.screencols) len = E.screencols;
|
||||||
abAppend(ab, &E.row[filerow].render[E.coloff], len);
|
char *c = &E.row[filerow].render[E.coloff];
|
||||||
|
int j;
|
||||||
|
for (j=0; j<len; j++) {
|
||||||
|
if (isdigit(c[j])) {
|
||||||
|
abAppend(ab, "\x1b[31m", 5);
|
||||||
|
abAppend(ab, &c[j], 1);
|
||||||
|
abAppend(ab, "\x1b[39m", 5);
|
||||||
|
} else {
|
||||||
|
abAppend(ab, &c[j], 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abAppend(ab, "\x1b[K", 3); // Erase one line
|
abAppend(ab, "\x1b[K", 3); // Erase one line
|
||||||
|
|
Loading…
Reference in a new issue