]> git.donarmstrong.com Git - org-ref.git/commitdiff
fix bug in adding to end of cite link
authorJohn Kitchin <jkitchin@andrew.cmu.edu>
Sun, 25 Jan 2015 19:02:28 +0000 (14:02 -0500)
committerJohn Kitchin <jkitchin@andrew.cmu.edu>
Sun, 25 Jan 2015 19:02:28 +0000 (14:02 -0500)
org-ref.org

index 1e03bdfb64fddae469e20ef88c1c759abdfd7da4..e4fc35b1315a3c2fd0ac7d6ffe73b25669252057 100644 (file)
@@ -2821,6 +2821,7 @@ Technically, this function should return a string that is inserted by helm. This
           (-contains?
            org-ref-cite-types
            (org-element-property :type object)))
+      (message-box "in a link")
       (goto-char (org-element-property :end object))
       ;; sometimes there are spaces at the end of the link
       ;; this code moves point pack until no spaces are there
@@ -2828,18 +2829,21 @@ Technically, this function should return a string that is inserted by helm. This
       (insert (concat "," (mapconcat 'identity keys ","))))
 
      ;; We are next to a link, and we want to append
+     ;; next to a link means one character back is on a link.
      ((save-excursion
        (backward-char)
        (and (equal (org-element-type (org-element-context)) 'link)
             (-contains?
              org-ref-cite-types
              (org-element-property :type (org-element-context)))))
-      (goto-char (org-element-property :end object))
+      (message-box "at end of a link")
+      ;; (goto-char (org-element-property :end object))
       (while (looking-back " ") (backward-char))
       (insert (concat "," (mapconcat 'identity keys ","))))
 
      ;; insert fresh link
      (t
+      (message-box "fresh link")
       (insert
        (concat (if helm-current-prefix-arg
                   (helm :sources `((name . "link types")