From a59bcfb9d1b372ad6a20cd5b14fcd03337923d43 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Thu, 24 Oct 2019 12:01:00 -0400 Subject: [PATCH] highlight search results in blue, step 151 --- src/Editor.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Editor.php b/src/Editor.php index 439aab1..8797bc5 100644 --- a/src/Editor.php +++ b/src/Editor.php @@ -543,6 +543,10 @@ class Editor { $this->cursorY = $current; $this->cursorX = $this->rowRxToCx($this->rows[$current], $match); $this->rowOffset = $this->numRows; + + // Update the highlight array of the relevant row with the 'MATCH' type + array_replace_range($this->rows[$current]->hl, $match, strlen($query), Highlight::MATCH); + break; } }