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

This commit is contained in:
Timothy Warren 2023-10-19 11:26:14 -04:00
parent 8cb783ed2f
commit 223371fb4a
1 changed files with 6 additions and 0 deletions

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;
}