瀏覽代碼

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 <dale@codefu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/100508>
Nicolas Goaziou 9 年之前
父節點
當前提交
af0704b4d5
共有 1 個文件被更改,包括 9 次插入5 次删除
  1. 9 5
      lisp/org.el

+ 9 - 5
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.