Remove syntax highlighting after exit the search #16

This commit is contained in:
Aaron Fischer 2019-01-22 11:52:00 +01:00
parent 4decff67fb
commit 81eec03773

View file

@ -4,6 +4,7 @@
#include <string.h> // for memcpy, memset, strlen, strstr #include <string.h> // for memcpy, memset, strlen, strstr
#include "fn.h" // for E, editorConfig, erow, editorPrompt, editorHighl... #include "fn.h" // for E, editorConfig, erow, editorPrompt, editorHighl...
#include "row.h" // for editorRowRxToCx #include "row.h" // for editorRowRxToCx
#include "hl.h"
void editorSearchCallback(char *query, int key) { void editorSearchCallback(char *query, int key) {
@ -19,9 +20,10 @@ void editorSearchCallback(char *query, int key) {
saved_hl = NULL; saved_hl = NULL;
} }
if (key == '\r' || key == '\xb') { if (key == '\r' || key == '\x1b') {
last_match = -1; last_match = -1;
direction = 1; direction = 1;
editorSelectSyntaxHighlight();
return; return;
} else if (key == ARROW_RIGHT || key == ARROW_DOWN) { } else if (key == ARROW_RIGHT || key == ARROW_DOWN) {
direction = 1; direction = 1;