branch: elpa/evil-lisp-state
commit 692507643f63d151145d7de302e193ba2af659ab
Author: syl20bnr <[email protected]>
Commit: syl20bnr <[email protected]>
Fix `o` and `O` behavior
---
evil-lisp-state.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/evil-lisp-state.el b/evil-lisp-state.el
index 3aff484d31..f7d6c423f0 100644
--- a/evil-lisp-state.el
+++ b/evil-lisp-state.el
@@ -189,18 +189,22 @@ of COMMAND.
(defun evil-lisp-state-insert-sexp-after ()
"Insert sexp after the current one."
(interactive)
+ (if (char-equal (char-after) ?\() (evil-lisp-state-forward-symbol))
(sp-up-sexp)
(evil-insert-state)
- (insert " ")
+ (sp-newline)
(sp-insert-pair "("))
(defun evil-lisp-state-insert-sexp-before ()
"Insert sexp before the current one."
(interactive)
- (sp-backward-up-sexp)
+ (if (char-equal (char-after) ?\() (evil-lisp-state-forward-symbol))
+ (sp-backward-sexp)
(evil-insert-state)
- (insert " ")
- (backward-char 1)
- (sp-insert-pair "("))
+ (sp-newline)
+ (evil-previous-visual-line)
+ (evil-end-of-line)
+ (sp-insert-pair "(")
+ (indent-for-tab-command))
(provide 'evil-lisp-state)