diff --git a/kilo b/kilo index 781d50f..4f91242 100755 --- a/kilo +++ b/kilo @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!/usr/bin/env php $no, 'message' => $str, 'file' => $file, 'line' => $line, - // 'context' => $context, ], TRUE); file_put_contents('kilo.log', $msg, FILE_APPEND); diff --git a/src/Editor.php b/src/Editor.php index 2b81c96..c059edf 100644 --- a/src/Editor.php +++ b/src/Editor.php @@ -736,7 +736,6 @@ class Editor { $this->refreshScreen(); $c = $this->readKey(); - $cord = ord($c); if ($c === Key::ESCAPE) { @@ -837,7 +836,7 @@ class Editor { $c = $this->readKey(); - if ($c === "\0") + if ($c === "\0" || $c === '') { return ''; } diff --git a/src/Row.php b/src/Row.php index 2aae6a5..a9988ed 100644 --- a/src/Row.php +++ b/src/Row.php @@ -147,6 +147,9 @@ class Row { T_OBJECT_CAST => Highlight::KEYWORD2, T_STRING_CAST => Highlight::KEYWORD2, T_UNSET_CAST => Highlight::KEYWORD2, + + // Invalid syntax + T_BAD_CHARACTER => Highlight::INVALID, ]; private array $phpCharacterHighlightMap = [