X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=blobdiff_plain;f=org-ref.org;h=2e9647faa72b444252106c9a9bab6c2b33ff8db2;hp=04746fe9c643408730cdf07700fb42264061a121;hb=7c808fb33c8a5412691a787e685e745f73d8c5fe;hpb=828c6fdc6640c263e054136431ce74680970da11 diff --git a/org-ref.org b/org-ref.org index 04746fe..2e9647f 100644 --- a/org-ref.org +++ b/org-ref.org @@ -3122,13 +3122,16 @@ To get a lighter weight message about the label, ref and cite links, we define a (link-string (org-element-property :path object)) (link-string-beginning) (link-string-end)) - (save-excursion (goto-char (org-element-property :begin object)) (search-forward link-string nil nil 1) (setq link-string-beginning (match-beginning 0)) (setq link-string-end (match-end 0))) + ;; make sure we are in link and not before the : + (when (> link-string-beginning (point)) + (goto-char link-string-beginning)) + ;; now if we have comma separated bibliographies ;; we find the one clicked on. we want to ;; search forward to next comma from point @@ -3136,6 +3139,7 @@ To get a lighter weight message about the label, ref and cite links, we define a (if (search-forward "," link-string-end 1 1) (setq key-end (- (match-end 0) 1)) ; we found a match (setq key-end (point)))) ; no comma found so take the point + ;; and backward to previous comma from point (save-excursion (if (search-backward "," link-string-beginning 1 1)