From 223371fb4ad68842069317d4b4ccadbe208110a2 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 19 Oct 2023 11:26:14 -0400 Subject: [PATCH] Fix the use case of editing a zero file --- src/Document.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Document.php b/src/Document.php index 2c8cf91..2d5fbc6 100644 --- a/src/Document.php +++ b/src/Document.php @@ -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; }