From 81eec037733a282f5f78b58ca1942fc234fec5bb Mon Sep 17 00:00:00 2001 From: Aaron Fischer Date: Tue, 22 Jan 2019 11:52:00 +0100 Subject: [PATCH] Remove syntax highlighting after exit the search #16 --- src/search.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;