From e24bb972f65f1d8b33ddbe9c7823c270e326080a Mon Sep 17 00:00:00 2001 From: Nicolas Petton Date: Thu, 25 Feb 2021 10:31:24 +0100 Subject: Do not insert a new line if the buffer is empty * nroam.el (nroam--insert): When the buffer is empty, do not insert a newline at it would be inserted at the beginning of the buffer. --- nroam.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nroam.el') diff --git a/nroam.el b/nroam.el index 54a1a30..e32559a 100644 --- a/nroam.el +++ b/nroam.el @@ -189,7 +189,8 @@ Make the region inserted by BODY read-only, and marked with (with-buffer-modified-unmodified (save-excursion (goto-char p) - (nroam--ensure-empty-line) + (unless (bobp) + (nroam--ensure-empty-line)) (with-nroam-markers (nroam--do-separated-by-newlines #'funcall nroam-sections)) (when (nroam--sections-inserted-p) -- cgit v1.2.3-54-g00ecf