Fix highlight color
This commit is contained in:
parent
37cbae591c
commit
506ec0cb6d
1 changed files with 4 additions and 11 deletions
15
nsh.c
15
nsh.c
|
@ -261,9 +261,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
if (isspace(buffer[i]) || (ispunct(buffer[i]) &&
|
if (isspace(buffer[i]) || (ispunct(buffer[i]) &&
|
||||||
buffer[i] != '_' && buffer[i] != '#')) {
|
buffer[i] != '_' && buffer[i] != '#')) {
|
||||||
if (word_len > 0 && buffer[i] != '*' &&
|
if (word_len > 0) {
|
||||||
buffer[i] != '&' && buffer[i] != '=' &&
|
|
||||||
buffer[i] != '+' && buffer[i] != '|') {
|
|
||||||
word[word_len] = '\0';
|
word[word_len] = '\0';
|
||||||
if (buffer[i] == '(' && !is_keyword(word) &&
|
if (buffer[i] == '(' && !is_keyword(word) &&
|
||||||
!is_type(word)) {
|
!is_type(word)) {
|
||||||
|
@ -291,14 +289,9 @@ int main(int argc, char **argv)
|
||||||
buffer[i] == '|' || buffer[i] == '!' ||
|
buffer[i] == '|' || buffer[i] == '!' ||
|
||||||
buffer[i] == '<' || buffer[i] == '>') {
|
buffer[i] == '<' || buffer[i] == '>') {
|
||||||
word[word_len++] = buffer[i];
|
word[word_len++] = buffer[i];
|
||||||
if (buffer[i+1] != '*' && buffer[i+1] != '&' &&
|
word[word_len] = '\0';
|
||||||
buffer[i+1] != '=' && buffer[i+1] != '+' &&
|
word_len = 0;
|
||||||
buffer[i+1] != '|' && buffer[i] != '!'&&
|
highlight_symbol(word);
|
||||||
buffer[i] != '<' && buffer[i] != '>') {
|
|
||||||
word[word_len] = '\0';
|
|
||||||
highlight_symbol(word);
|
|
||||||
word_len = 0;
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
printf("%c", buffer[i]);
|
printf("%c", buffer[i]);
|
||||||
|
|
Loading…
Reference in a new issue