summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-10-23 01:32:55 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-10-23 01:32:55 +0200
commitc76486d4e431bf0c67d371341eb28445e7de4517 (patch)
treef3f0c55d908e4db7aec8745b557d744560482e78
parent7a4a10dea036658633060f4a43dcc95e6b5b4423 (diff)
downloadorg-mode-c76486d4e431bf0c67d371341eb28445e7de4517.tar.gz
org-capture: Fix off-by-one error
* lisp/org-capture.el (org-capture-place-table-line): Fix narrowing.
-rw-r--r--lisp/org-capture.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index f327bd0..ff80808 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1279,7 +1279,9 @@ may have been stored before."
(point))))
(org-capture-position-for-last-stored 'table-line)
(org-capture-mark-kill-region origin end)
- (org-capture-narrow beg end)
+ ;; TEXT is guaranteed to end with a newline character. Ignore
+ ;; it when narrowing so as to not alter data on the next line.
+ (org-capture-narrow beg (1- end))
(when (or (search-backward "%?" beg t)
(search-forward "%?" end t))
(replace-match "")))