From 155340df66d47847583ce7a497b7704410fad452 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Tue, 5 Nov 2019 13:51:21 -0500 Subject: [PATCH] Misc updates --- kilo | 2 +- src/Editor.php | 2 +- src/Row.php | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kilo b/kilo index a498f89..5b167ba 100755 --- a/kilo +++ b/kilo @@ -6,7 +6,7 @@ namespace Kilo; // ----------------------------------------------------------------------------- // ! App Constants // ----------------------------------------------------------------------------- -define('KILO_VERSION', '0.0.1'); +define('KILO_VERSION', '0.1.0'); define('KILO_TAB_STOP', 4); define('KILO_QUIT_TIMES', 3); diff --git a/src/Editor.php b/src/Editor.php index 9aed671..0bb08b4 100644 --- a/src/Editor.php +++ b/src/Editor.php @@ -536,7 +536,7 @@ class Editor { $filerow = $y + $this->rowOffset; if ($filerow >= $this->numRows) { - if ($this->numRows === 0 && $y === $this->screenRows / 3) + if ($this->numRows === 0 && $y === (int)($this->screenRows / 2)) { $welcome = sprintf('PHP Kilo editor -- version %s', KILO_VERSION); $welcomelen = strlen($welcome); diff --git a/src/Row.php b/src/Row.php index 2bd1be1..4861031 100644 --- a/src/Row.php +++ b/src/Row.php @@ -244,6 +244,9 @@ class Row { { $idx = 0; + // Make sure the render buffer is empty before updating + // otherwise, you will have persistent output where you + // don't want it. $this->render = ''; for ($i = 0; $i < $this->size; $i++)