Fixes rendering glitch for resuming normal foreground color
This commit is contained in:
parent
fb2d22d019
commit
e310844ef3
6
hermes.c
6
hermes.c
|
@ -735,12 +735,12 @@ void editorDrawRows(struct abuf *ab) {
|
|||
abAppend(ab, buf, clen);
|
||||
}
|
||||
} else if (hl[j] == HL_NORMAL) {
|
||||
if (current_color != -1) {
|
||||
int color = editorSyntaxToColor(hl[j]);
|
||||
if (current_color != -1) {
|
||||
current_color = -1;
|
||||
char buf[16];
|
||||
int clen = snprintf(buf, sizeof(buf), "\033[38;5;%dm", color);
|
||||
abAppend(ab, "\033[39m", clen);
|
||||
current_color = -1;
|
||||
abAppend(ab, buf, clen);
|
||||
}
|
||||
editorDrawVisualBg(ab, 0, j, filerow, len);
|
||||
abAppend(ab, &c[j], 1);
|
||||
|
|
16
syntaxhl.h
16
syntaxhl.h
|
@ -69,7 +69,7 @@ char *SH_HL_keywords[] = {
|
|||
"export", "else", "while", "do|", "done|", "for", "until", "case",
|
||||
"esac", "break|", "continue|", "exit", "return", "trap|", "wait|",
|
||||
"eval|", "exec|", "ulimit|", "umask|", NULL
|
||||
}
|
||||
};
|
||||
|
||||
// HTML
|
||||
char *HTML_HL_keywords[] = {
|
||||
|
@ -78,7 +78,7 @@ char *HTML_HL_keywords[] = {
|
|||
"form", "input", "class|", "id|", "href|", "img", "src|", "target|",
|
||||
"style|", "meta", "h1", "h2", "h3", "h4", "h5", "role|", "!DOCTYPE|",
|
||||
"script", "type|", "link", "rel|", NULL
|
||||
}
|
||||
};
|
||||
|
||||
// PHP
|
||||
char *PHP_HL_keywords[] = {
|
||||
|
@ -91,14 +91,14 @@ char *PHP_HL_keywords[] = {
|
|||
"isset|", "list|", "namespace", "new|", "or|", "print|", "private|", "protected|",
|
||||
"public|", "require", "require_once", "return", "static|", "switch", "throw",
|
||||
"trait|", "try", "unset|", "use|", "var|", "while", "xor|", "yield", NULL
|
||||
}
|
||||
};
|
||||
|
||||
// Lua
|
||||
char *LUA_HL_keywords[] = {
|
||||
"function", "return", "for", "while", "do", "if", "else", "elseif",
|
||||
"and|", "or|", "false|", "true|", "nil|", "until", "then|", "repeat|",
|
||||
"local|", "not|", "in|", "break|", NULL
|
||||
}
|
||||
};
|
||||
|
||||
static struct editorSyntax HLDB[] = {
|
||||
// 3. Add an entry to the editorSyndax db (this var).
|
||||
|
@ -136,19 +136,19 @@ static struct editorSyntax HLDB[] = {
|
|||
"shell",
|
||||
SH_HL_extensions,
|
||||
"#",
|
||||
NULL,
|
||||
NULL,
|
||||
"",
|
||||
"",
|
||||
SH_HL_keywords,
|
||||
HL_HIGHLIGHT_NUMBERS | HL_HIGHLIGHT_STRINGS
|
||||
},
|
||||
{
|
||||
"html",
|
||||
HTML_HL_extensions,
|
||||
NULL,
|
||||
"",
|
||||
"<!--",
|
||||
"-->",
|
||||
HTML_HL_keywords,
|
||||
NULL
|
||||
HL_HIGHLIGHT_NUMBERS
|
||||
},
|
||||
{
|
||||
"php",
|
||||
|
|
Loading…
Reference in New Issue