diff options
| author | Somelauw <Somelauw> | 2017-10-22 23:40:15 +0200 |
|---|---|---|
| committer | Somelauw <Somelauw> | 2017-10-22 23:40:15 +0200 |
| commit | 84d4a509d230b943ae56ac2283dc61fc62a55ff1 (patch) | |
| tree | 824f5fc2cfacafca78a2274c79e6c311691968a4 | |
| parent | 242e637255bbce1694f77f9c05989ff11c97097a (diff) | |
Fix issue with o/O not indenting.
For some reason combinding evil-open-below with evil-insert undoes the
indentation.
| -rw-r--r-- | evil-org.el | 22 |
1 files 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) |
