summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Persaud <apersaud@lbl.gov>2014-03-12 19:08:17 +0100
committerBastien Guerry <bzg@altern.org>2014-03-12 19:08:17 +0100
commit9323857411587db10b51621bc1fb5370e527866d (patch)
tree2b033ada62f105d7df75d616b3d3a4fc4d972cd4
parentf0e5683a120fbd4acf722218e19022f13e7990c7 (diff)
downloadorg-mode-9323857411587db10b51621bc1fb5370e527866d.tar.gz
org-src.el (org-edit-src-exit): Don't add indentation on empty lines
* org-src.el (org-edit-src-exit): Don't add indentation on empty lines. TINYCHANGE
-rw-r--r--lisp/org-src.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 4ca123d..6f481e0 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -737,8 +737,10 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
(unless (or single preserve-indentation (= total-nindent 0))
(setq indent (make-string total-nindent ?\ ))
(goto-char (point-min))
- (while (re-search-forward "^" nil t)
- (replace-match indent)))
+ (while (re-search-forward "^" nil t)
+ (if (not (looking-at "$"))
+ (replace-match indent)
+ (forward-char 1))))
(if (org-bound-and-true-p org-edit-src-picture)
(setq total-nindent (+ total-nindent 2)))
(setq code (buffer-string))