mirror of https://github.com/Sam1301/Lite.git
Syntax Highlighting: Green color digits.
This commit is contained in:
parent
0de0c9cef1
commit
2904b1ae25
13
editor.c
13
editor.c
|
@ -556,7 +556,18 @@ void editorDrawRows(struct AppendBuffer* ab) {
|
|||
if (len > E.screencols) {
|
||||
len = E.screencols;
|
||||
}
|
||||
abAppend(ab, &E.erow[fileRow].render[E.colOff], len);
|
||||
|
||||
char *c = &E.erow[fileRow].render[E.colOff];
|
||||
int j;
|
||||
for (j = 0; j < len; j++) {
|
||||
if (isdigit(c[j])) {
|
||||
abAppend(ab, "\x1b[32m", 5);
|
||||
abAppend(ab, &c[j], 1);
|
||||
abAppend(ab, "\x1b[39m", 5);
|
||||
} else {
|
||||
abAppend(ab, &c[j], 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
abAppend(ab, "\x1b[K", 3); // clear rest of current line
|
||||
|
|
Loading…
Reference in New Issue