From af0704b4d54fd83bcf819492fedef69def8d03e9 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 26 Aug 2015 22:18:21 +0200 Subject: [PATCH] Fix column view display when editing a property * lisp/org.el (org-insert-property-drawer): Ensure insertion of new property drawer happens in current entry so as to not mess with next's overlays. Reported-by: Dale --- lisp/org.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ed93ef923..161e85185 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -16221,11 +16221,15 @@ COLUMN formats in the current buffer." (forward-line) (when (org-looking-at-p org-planning-line-re) (forward-line)) (unless (org-looking-at-p org-property-drawer-re) - (let ((inhibit-read-only t)) - (unless (bolp) (insert "\n")) - (let ((begin (point))) - (insert ":PROPERTIES:\n:END:\n") - (org-indent-region begin (point))))))) + ;; Make sure we start editing a line from current entry, not from + ;; next one. It prevents extending text properties or overlays + ;; belonging to the latter. + (when (bolp) (backward-char)) + (let ((begin (1+ (point))) + (inhibit-read-only t)) + (insert "\n:PROPERTIES:\n:END:") + (when (eobp) (insert "\n")) + (org-indent-region begin (point)))))) (defun org-insert-drawer (&optional arg drawer) "Insert a drawer at point.