diff options
| author | Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de> | 2013-08-12 08:33:19 +0200 |
|---|---|---|
| committer | Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de> | 2013-08-12 08:33:19 +0200 |
| commit | afd1a162963210ba44da0395bdd1a31077ae14a7 (patch) | |
| tree | 13dab80f4cc4dd1328aa1b816c557f1383f4eede /evil-integration.el | |
| parent | d772e89ae6ee36cb0e688b6686934d8cf30eaeed (diff) | |
| parent | eb29b1cf565e481ef6ca5b9933a06289afbf3950 (diff) | |
Merge fix for #315.
Diffstat (limited to 'evil-integration.el')
| -rw-r--r-- | evil-integration.el | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/evil-integration.el b/evil-integration.el index 9707133..50ca3f7 100644 --- a/evil-integration.el +++ b/evil-integration.el @@ -287,6 +287,8 @@ This includes restricting `ace-jump-mode' to the current window in visual and operator state, deactivating visual updates, saving the mark and entering `recursive-edit'." + (declare (indent defun) + (debug t)) `(let ((old-mark (mark)) (ace-jump-mode-scope (if (and (not (memq evil-state '(visual operator))) @@ -332,8 +334,30 @@ the mark and entering `recursive-edit'." "Jump visually directly to a char using ace-jump." :type inclusive (evil-without-repeat - (evil-enclose-ace-jump-for-motion - (call-interactively #'ace-jump-char-mode)))) + (let ((pnt (point)) + (buf (current-buffer))) + (evil-enclose-ace-jump-for-motion + (call-interactively #'ace-jump-char-mode)) + ;; if we jump backwards, motion type is exclusive, analogously + ;; to `evil-find-char-backward' + (when (and (equal buf (current-buffer)) + (< (point) pnt)) + (setq evil-this-type 'exclusive))))) + +(evil-define-motion evil-ace-jump-char-to-mode (count) + "Jump visually to the char in front of a char using ace-jump." + :type inclusive + (evil-without-repeat + (let ((pnt (point)) + (buf (current-buffer))) + (evil-enclose-ace-jump-for-motion + (call-interactively #'ace-jump-char-mode)) + (if (and (equal buf (current-buffer)) + (< (point) pnt)) + (progn + (or (eobp) (forward-char)) + (setq evil-this-type 'exclusive)) + (backward-char))))) (evil-define-motion evil-ace-jump-line-mode (count) "Jump visually to the beginning of a line using ace-jump." @@ -341,7 +365,7 @@ the mark and entering `recursive-edit'." :repeat abort (evil-without-repeat (evil-enclose-ace-jump-for-motion - (call-interactively #'ace-jump-line-mode)))) + (call-interactively #'ace-jump-line-mode)))) (evil-define-motion evil-ace-jump-word-mode (count) "Jump visually to the beginning of a word using ace-jump." @@ -349,15 +373,7 @@ the mark and entering `recursive-edit'." :repeat abort (evil-without-repeat (evil-enclose-ace-jump-for-motion - (call-interactively #'ace-jump-word-mode)))) - -(evil-define-motion evil-ace-jump-char-to-mode (count) - "Jump visually to the char in front of a char using ace-jump." - :type exclusive - :repeat abort - (evil-without-repeat - (evil-enclose-ace-jump-for-motion - (call-interactively #'ace-jump-char-mode)))) + (call-interactively #'ace-jump-word-mode)))) (define-key evil-motion-state-map [remap ace-jump-char-mode] #'evil-ace-jump-char-mode) (define-key evil-motion-state-map [remap ace-jump-line-mode] #'evil-ace-jump-line-mode) |
