Browse Source

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.
master
Nicolas Petton 1 month ago
parent
commit
e24bb972f6
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      nroam.el

+ 2
- 1
nroam.el View File

@ -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)


Loading…
Cancel
Save