Merge pull request #466 from Guldoman/new_not_dirty

Avoid setting a new file as dirty if it is empty
This commit is contained in:
Francesco 2021-10-10 10:05:19 +02:00 committed by GitHub
commit 228d6ff101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -102,7 +102,11 @@ end
function Doc:is_dirty()
return self.clean_change_id ~= self:get_change_id() or self.new_file
if self.new_file then
return #self.lines > 1 or #self.lines[1] > 1
else
return self.clean_change_id ~= self:get_change_id()
end
end