From 84d4a509d230b943ae56ac2283dc61fc62a55ff1 Mon Sep 17 00:00:00 2001 From: Somelauw Date: Sun, 22 Oct 2017 23:40:15 +0200 Subject: Fix issue with o/O not indenting. For some reason combinding evil-open-below with evil-insert undoes the indentation. --- evil-org.el | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/evil-org.el b/evil-org.el index 238d608..fc01479 100644 --- a/evil-org.el +++ b/evil-org.el @@ -245,13 +245,14 @@ Argument COUNT number of lines to insert. The behavior in items and tables can be controlled using ‘evil-org-special-o/O’. Passing in any prefix argument, executes the command without special behavior." (interactive "P") - (end-of-visible-line) ; to make items be inserted at the end (cond ((and (memq 'table-row evil-org-special-o/O) (org-at-table-p)) - (org-table-insert-row '(4))) + (org-table-insert-row '(4)) + (evil-insert nil)) ((and (memq 'item evil-org-special-o/O) (org-at-item-p) - (org-insert-item (org-at-item-checkbox-p)))) - ((evil-open-below count))) - (evil-insert nil)) + (progn (end-of-visible-line) + (org-insert-item (org-at-item-checkbox-p)))) + (evil-insert nil)) + ((evil-open-below count)))) (defun evil-org-open-above (count) "Clever insertion of org item. @@ -259,12 +260,15 @@ Argument COUNT number of lines to insert. The behavior in items and tables can be controlled using ‘evil-org-special-o/O’. Passing in any prefix argument, executes the command without special behavior." (interactive "P") - (beginning-of-line) ; to make items be inserted at the beginning (cond ((and (memq 'table-row evil-org-special-o/O) (org-at-table-p)) - (org-table-insert-row)) + (org-table-insert-row) + (evil-insert nil)) ((and (memq 'item evil-org-special-o/O) (org-at-item-p) - (org-insert-item (org-at-item-checkbox-p)))) - ((evil-open-above count))) + (progn (beginning-of-line) + (org-insert-item (org-at-item-checkbox-p)))) + (evil-insert nil)) + ((evil-open-above count)))) + (evil-insert nil)) (defmacro evil-org-define-eol-command (cmd) -- cgit v1.0