summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Nicolas Petton2021-02-23 22:17:35 +0100
committerGravatar Nicolas Petton2021-02-23 22:27:17 +0100
commit58d4bcf5f53e6598aa901d8f21c9bb2d9c65191b (patch)
tree4e57119bb07ff853fc869a6c9610723597e46524
parent02a791bf971c43dac2f95801a91bfd6a9f3756fc (diff)
downloadnroam-58d4bcf5f53e6598aa901d8f21c9bb2d9c65191b.tar.gz
nroam-58d4bcf5f53e6598aa901d8f21c9bb2d9c65191b.zip
Fix nroam--point-at-section-p
* Fix `nroam--point-at-section-p' when nroam sections have not been inserted.
-rw-r--r--nroam.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/nroam.el b/nroam.el
index 322fd41..d30b8e4 100644
--- a/nroam.el
+++ b/nroam.el
@@ -139,9 +139,10 @@ Make the region inserted by BODY read-only, and marked with
(defun nroam--point-at-section-p ()
"Return non-hil if point if on the backlinks section."
- (when-let* ((beg (marker-position nroam-start-marker))
- (end (marker-position nroam-end-marker)))
- (<= beg (point) end)))
+ (when (nroam--sections-inserted-p)
+ (when-let* ((beg (marker-position nroam-start-marker))
+ (end (marker-position nroam-end-marker)))
+ (<= beg (point) end))))
(defun nroam--update-maybe ()
"Update backlinks when in nroam-mode."