Mac fixes
Some checks failed
Gitea - Tutorials/php-kilo/master There was a failure building this commit
Some checks failed
Gitea - Tutorials/php-kilo/master There was a failure building this commit
This commit is contained in:
parent
30440e577a
commit
f5aafb465a
5
kilo
5
kilo
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/php
|
||||
#!/usr/bin/env php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Aviat\Kilo;
|
||||
@ -6,13 +6,12 @@ namespace Aviat\Kilo;
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
// Log notices/errors/warnings to file
|
||||
set_error_handler(static function (int $no, $str, $file, $line, $context) {
|
||||
set_error_handler(static function (int $no, $str, $file, $line) {
|
||||
$msg = print_r([
|
||||
'errno' => $no,
|
||||
'message' => $str,
|
||||
'file' => $file,
|
||||
'line' => $line,
|
||||
// 'context' => $context,
|
||||
], TRUE);
|
||||
file_put_contents('kilo.log', $msg, FILE_APPEND);
|
||||
|
||||
|
@ -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 '';
|
||||
}
|
||||
|
@ -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 = [
|
||||
|
Loading…
Reference in New Issue
Block a user