From f5aafb465a1dcea64af4348e111b1b95737e2d09 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Mon, 2 Dec 2019 09:44:11 -0500 Subject: [PATCH] Mac fixes --- kilo | 5 ++--- src/Editor.php | 3 +-- src/Row.php | 3 +++ 3 files changed, 6 insertions(+), 5 deletions(-) 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 = [