diff options
author | Nicolas Petton | 2021-02-22 22:44:53 +0100 |
---|---|---|
committer | Nicolas Petton | 2021-02-22 22:44:53 +0100 |
commit | 40ba80de1a79b435f396adbe7d9045dfb99c6385 (patch) | |
tree | 32f36ec5750fffdf631df5a68f5bf37ab9401400 /nroam.el | |
parent | b892bcaa9469aedb5b32f4eaf03a2151a0588c64 (diff) | |
download | nroam-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.el | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 |