Browse Source

fix bug when replacing results hashes

* lisp/ob-core.el (org-babel-set-current-result-hash): Updated the
  match-string holding the hash data, and correct overlay maintenance.
Eric Schulte 11 years ago
parent
commit
895bae8774
1 changed files with 6 additions and 3 deletions
  1. 6 3
      lisp/ob-core.el

+ 6 - 3
lisp/ob-core.el

@@ -1169,9 +1169,12 @@ the current subtree."
 (defun org-babel-set-current-result-hash (hash)
   "Set the current in-buffer hash to HASH."
   (org-babel-where-is-src-block-result)
-  (save-excursion (goto-char (match-beginning 3))
-		  ;; (mapc #'delete-overlay (overlays-at (point)))
-		  (replace-match hash nil nil nil 3)
+  (save-excursion (goto-char (match-beginning 5))
+		  (mapc #'delete-overlay (overlays-at (point)))
+		  (forward-char org-babel-hash-show)
+		  (mapc #'delete-overlay (overlays-at (point)))
+		  (replace-match hash nil nil nil 5)
+		  (goto-char (point-at-bol))
 		  (org-babel-hide-hash)))
 
 (defun org-babel-hide-hash ()