diff --git a/src/search.c b/src/search.c index 0e3cd13..337f024 100644 --- a/src/search.c +++ b/src/search.c @@ -4,6 +4,7 @@ #include // for memcpy, memset, strlen, strstr #include "fn.h" // for E, editorConfig, erow, editorPrompt, editorHighl... #include "row.h" // for editorRowRxToCx +#include "hl.h" void editorSearchCallback(char *query, int key) { @@ -19,9 +20,10 @@ void editorSearchCallback(char *query, int key) { saved_hl = NULL; } - if (key == '\r' || key == '\xb') { + if (key == '\r' || key == '\x1b') { last_match = -1; direction = 1; + editorSelectSyntaxHighlight(); return; } else if (key == ARROW_RIGHT || key == ARROW_DOWN) { direction = 1;