summaryrefslogtreecommitdiffstatshomepage
path: root/nroam.el
diff options
context:
space:
mode:
authorGravatar Nicolas Petton2021-02-22 22:44:53 +0100
committerGravatar Nicolas Petton2021-02-22 22:44:53 +0100
commit40ba80de1a79b435f396adbe7d9045dfb99c6385 (patch)
tree32f36ec5750fffdf631df5a68f5bf37ab9401400 /nroam.el
parentb892bcaa9469aedb5b32f4eaf03a2151a0588c64 (diff)
downloadnroam-40ba80de1a79b435f396adbe7d9045dfb99c6385.tar.gz
nroam-40ba80de1a79b435f396adbe7d9045dfb99c6385.zip
Add the empty line as part of linked references section
Do no add the empty line above the linked references section so that it is not written to files.
Diffstat (limited to 'nroam.el')
-rw-r--r--nroam.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/nroam.el b/nroam.el
index 5c1de09..bbadffb 100644
--- a/nroam.el
+++ b/nroam.el
@@ -102,7 +102,6 @@ Make the region inserted by BODY read-only, and marked with
(interactive)
(nroam--setup-markers)
(nroam--prune-backlinks)
- (nroam--ensure-empty-line)
(nroam--insert-backlinks))
(defun nroam--update-backlinks-maybe ()
@@ -139,6 +138,7 @@ Make the region inserted by BODY read-only, and marked with
(save-excursion
(goto-char (point-max))
(with-nroam-markers
+ (nroam--ensure-empty-line)
(nroam--insert-backlinks-heading (seq-length backlinks))
(seq-do #'nroam--insert-backlink-group groups)))
(nroam--hide-drawers))))
@@ -250,9 +250,8 @@ Temporary fix until `org-roam' v2 is out."
(defun nroam--ensure-empty-line ()
"Insert a newline character if the buffer does not end with a newline."
(let ((inhibit-read-only t))
- (save-excursion
- (goto-char (point-max))
- (unless (eq ?\n (char-before (1- (point)))) (insert "\n")))))
+ (goto-char (point-max))
+ (unless (eq ?\n (char-before (1- (point)))) (insert "\n"))))
(provide 'nroam)
;;; nroam.el ends here