diff options
| author | Somelauw <Somelauw> | 2017-12-24 16:50:12 +0100 |
|---|---|---|
| committer | Somelauw <Somelauw> | 2017-12-24 16:53:50 +0100 |
| commit | 22c248deb6c74a5bcdb0268306eed878a44fe517 (patch) | |
| tree | e35b88e86a0227ceb65d55a38e03d2196a4b7ff6 | |
| parent | 5c01f573920e4794f812c30e7fd8f0bfb9734286 (diff) | |
Solve some issues with evil-org-return
- First issue: Empty line weren't detected well on item lists in some
cases
- Second issue: evil-org-indent should not indent when line at point is
empty
| -rw-r--r-- | evil-org.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/evil-org.el b/evil-org.el index d1bed93..1d5f288 100644 --- a/evil-org.el +++ b/evil-org.el @@ -7,7 +7,7 @@ ;; Git-Repository: git://github.com/Somelauw/evil-org-mode.git ;; Created: 2012-06-14 ;; Forked-since: 2017-02-12 -;; Version: 1.0.0 +;; Version: 1.0.2 ;; Package-Requires: ((emacs "24.4") (evil "1.0")) ;; Keywords: evil vim-emulation org-mode key-bindings presets @@ -280,7 +280,9 @@ The behavior of this function can be controlled using `evil-org-special-o/O’." (cond ((and (not arg) (evil-org--empty-element-p)) (delete-region (line-beginning-position) (line-end-position))) ((eolp) - (call-interactively #'evil-org-open-below)) + (if (bolp) + (call-interactively #'org-return) + (call-interactively #'evil-org-open-below))) ('otherwise (call-interactively #'org-return-indent)))) @@ -291,10 +293,8 @@ The behavior of this function can be controlled using `evil-org-special-o/O’." (row (nth (1- (org-table-current-line)) rows))) (cl-every 'string-empty-p row))) ((org-at-item-p) - (let ((e (org-element-at-point))) - (or (not (org-element-property :contents-begin e)) - (> (org-element-property :contents-begin e) - (line-end-position))))))) + (string-match-p "^[[:space:]]*-[[:space:]]*\\(::[[:space:]]*\\)?$" + (thing-at-point 'line))))) (defmacro evil-org-define-eol-command (cmd) "Return a function that executes CMD at eol and then enters insert state. |
