Fix the use case of editing a zero file
Some checks failed
timw4mail/php-kilo/pipeline/head There was a failure building this commit

This commit is contained in:
Timothy Warren 2023-10-19 11:26:14 -04:00
parent 8cb783ed2f
commit 223371fb4a

View File

@ -78,6 +78,12 @@ class Document {
$this->dirty = false;
$this->selectSyntaxHighlight();
// Add a row to empty files so it can be properly edited
if ($this->isEmpty())
{
$this->rows[] = Row::new($this, "", 0);
}
return $this;
}