Red color search match results.

This commit is contained in:
Saumya Bhatnagar 2018-06-03 05:40:41 +05:30
parent cf63e26f0c
commit 9c0187919c
2 changed files with 5 additions and 1 deletions

BIN
editor

Binary file not shown.

View File

@ -39,7 +39,8 @@ enum editorKey {
enum editorHighlight {
HL_NORMAL = 0,
HL_NUMBER
HL_NUMBER,
HL_MATCH
};
/*** data ***/
@ -232,6 +233,8 @@ int editorSyntaxToColor(int hl) {
switch (hl) {
case HL_NUMBER:
return 32;
case HL_MATCH: // search query match
return 31;
default:
return 37;
}
@ -532,6 +535,7 @@ void editorFindCallback(char* query, int cur_key) {
screen refresh so that the matching line will be at the very
top of the screen.*/
E.rowOff = E.numrows;
memset(&erow->hl[match - erow->render], HL_MATCH, strlen(query));
break;
}
}