Kungsgeten / yankpad

Paste snippets from an org-mode file
MIT License
216 stars 18 forks source link

yankpad--trigger-snippet-func needs updating because of commit de672da #27

Closed Wibjarm closed 6 years ago

Wibjarm commented 6 years ago

The snippets returned by yankpad--snippets changed format a bit, and yankpad--trigger-snippet-func needs to be adjusted to handle it the same way a couple of other things were. It's a pretty minor change, just this:

diff --git a/yankpad.el b/yankpad.el
index e5f7331..df0c24b 100644
--- a/yankpad.el
+++ b/yankpad.el
@@ -225,11 +225,11 @@ Use yasnippet and `yas-indent-line' if available."
   "SNIPPETNAME can be an elisp function, without arguments, if CONTENT is nil.
 If non-nil, CONTENT should hold a single `org-mode' src-block, to be executed.
 Return the result of the function output as a string."
-  (if (car content)
+  (if (> (length content) 0)
       (with-temp-buffer
         (delay-mode-hooks
           (org-mode)
-          (insert (car content))
+          (insert content)
           (goto-char (point-min))
           (if (org-in-src-block-p)
               (prin1-to-string (org-babel-execute-src-block))

EDIT: Sorry, this came off kind of rushed and abrasive. I can file a PR for this if you'd prefer.

Kungsgeten commented 6 years ago

Thanks for notifying me on this! Sorry it took so long to fix.