summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Nicolas Petton2021-02-25 10:31:24 +0100
committerGravatar Nicolas Petton2021-02-25 10:31:24 +0100
commite24bb972f65f1d8b33ddbe9c7823c270e326080a (patch)
tree36f0d91462fc50ffa88cc315b31f417ee9244afc
parent4ff1c7d89b944ea9bdef4e9d47915e5f4fe56cc6 (diff)
downloadnroam-e24bb972f65f1d8b33ddbe9c7823c270e326080a.tar.gz
nroam-e24bb972f65f1d8b33ddbe9c7823c270e326080a.zip
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.
-rw-r--r--nroam.el3
1 files changed, 2 insertions, 1 deletions
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)