diff options
| author | Somelauw <Somelauw> | 2018-03-09 11:48:18 +0100 |
|---|---|---|
| committer | Somelauw <Somelauw> | 2018-03-09 11:48:18 +0100 |
| commit | ee5bf68319998fbdc6b97a187e8d1c4feb806a44 (patch) | |
| tree | 2596cd651d1fb8576dc8378212aa532f4a9ff2d0 | |
| parent | 491b0b302b95d44ceb73d291dedbb9d5517ccee2 (diff) | |
Make post-blank work correctly on org objects
Fixes https://github.com/Somelauw/evil-org-mode/issues/34
| -rw-r--r-- | evil-org.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/evil-org.el b/evil-org.el index fcb0bd9..ef73e90 100644 --- a/evil-org.el +++ b/evil-org.el @@ -508,14 +508,18 @@ If a prefix argument is given, links are opened in incognito mode." (defun evil-org-select-inner-element (element) "Select inner org ELEMENT." (list (or (org-element-property :contents-begin element) + (org-element-property :post-affiliated element) (org-element-property :begin element)) (or (org-element-property :contents-end element) ;; Prune post-blank lines from :end element (save-excursion (goto-char (org-element-property :end element)) (let ((post-blank (org-element-property :post-blank element))) + ;; post-blank is charwise for objects and linewise for elements (unless (zerop post-blank) - (forward-line (- post-blank)))) + (if (memq (org-element-type element) org-element-all-objects) + (forward-char (- post-blank)) + (forward-line (- post-blank))))) (point))))) (defun evil-org-parent (element) @@ -712,7 +716,6 @@ Includes tables, list items and subtrees." org-shiftup-final-hook)) (add-hook hook #'evil-org-shift-fallback-command 'append))))) - (defun evil-org--populate-todo-bindings () "Bindings for easy todo insertion." (evil-define-key 'normal evil-org-mode-map |
