25 lines
550 B
PHP
25 lines
550 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
require_once __DIR__."/../vendor/autoload.php";
|
||
|
|
|
||
|
|
$filename = $argv[1]??null; // ?(__DIR__."/../composer.json");
|
||
|
|
|
||
|
|
$terminal = new NoccyLabs\JEdit\Terminal\Terminal();
|
||
|
|
|
||
|
|
$editor = new NoccyLabs\JEdit\Editor\Editor($terminal);
|
||
|
|
if ($filename) {
|
||
|
|
$editor->loadFile($filename);
|
||
|
|
} else {
|
||
|
|
$editor->loadDocument((object)[]);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
set_exception_handler(function (\Throwable $t) use ($terminal) {
|
||
|
|
register_shutdown_function(function () use ($t, $terminal) {
|
||
|
|
$terminal->shutdown();
|
||
|
|
echo $t."\n";
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
$editor->run();
|