Просмотр исходного кода

ensure inserted results end in a newline

Eric Schulte 17 лет назад
Родитель
Сommit
488fa39b27
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      litorgy/litorgy.el

+ 5 - 0
litorgy/litorgy.el

@@ -149,6 +149,11 @@ form.  (language body header-arguments-alist)"
 current source block.  With optional argument REPLACE replace any
 current source block.  With optional argument REPLACE replace any
 existing results currently located after the source block."
 existing results currently located after the source block."
   (if replace (litorgy-remove-result))
   (if replace (litorgy-remove-result))
+  (unless (or (string-equal (substring result -1)
+                            "\n")
+              (string-equal (substring result -1)
+                            "\r"))
+    (setq result (concat result "\n")))
   (save-excursion
   (save-excursion
     (re-search-forward "^#\\+end_src" nil t) (open-line 1) (forward-char 2)
     (re-search-forward "^#\\+end_src" nil t) (open-line 1) (forward-char 2)
     (let ((beg (point))
     (let ((beg (point))