diff --git a/composer.lock b/composer.lock index 1e23b8b..d6ba639 100644 --- a/composer.lock +++ b/composer.lock @@ -1487,7 +1487,11 @@ }, { "name": "symfony/yaml", +<<<<<<< HEAD "version": "v5.0.4", +======= + "version": "v5.0.3", +>>>>>>> 60b1cca69588ba4af02246586f5e3c86eeeddd65 "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", diff --git a/src/Editor.php b/src/Editor.php index 1d9d607..f569760 100644 --- a/src/Editor.php +++ b/src/Editor.php @@ -448,20 +448,18 @@ class Editor { $current = 0; } - $row = $this->rows[$current]; - - $match = strpos($row->render, $query); + $match = strpos($this->rows[$current]->render, $query); if ($match !== FALSE) { $lastMatch = $current; $this->cursorY = $current; - $this->cursorX = $this->rowRxToCx($row, $match); + $this->cursorX = $this->rowRxToCx($this->rows[$current], $match); $this->rowOffset = $this->numRows; $savedHlLine = $current; - $savedHl = $row->hl; + $savedHl = $this->rows[$current]->hl; // Update the highlight array of the relevant row with the 'MATCH' type - array_replace_range($row->hl, $match, strlen($query), Highlight::MATCH); + array_replace_range($this->rows[$current]->hl, $match, strlen($query), Highlight::MATCH); break; }