branch: elpa/evil-matchit commit d1f59ad941ec8237daad49ae94c9ecbd516c0748 Merge: d005e0465e 593c2d53a7 Author: Chen Bin <chenbin...@gmail.com> Commit: GitHub <nore...@github.com>
Merge pull request #131 from nbfalcon/bugfix/evilmi-sdk-simple-jump-whitespace `evilmi-sdk-simple-jump': skip comments --- evil-matchit-sdk.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/evil-matchit-sdk.el b/evil-matchit-sdk.el index 30fa1ea38e..8e8bc58fe9 100644 --- a/evil-matchit-sdk.el +++ b/evil-matchit-sdk.el @@ -153,7 +153,17 @@ If IS-FORWARD is t, jump forward; or else jump backward." (defun evilmi-sdk-simple-jump () "Alternative for `evil-jump-item'." (if evilmi-debug (message "evilmi-sdk-simple-jump called (point)=%d" (point))) - (skip-syntax-forward " ") + (let ((old (point))) + (skip-syntax-forward " ") + ;; If we move from a non-comment to before a comment, + ;; `evilmi-sdk-jumpto-where' wont skip it: + ;; + ;; <point> /* comment */ {} + ;; + ;; Is skipped because we go back, but wouldn't be if we didn't (due to + ;; checking for `evilmi-sdk-comment-p'). + (when (and (not (evilmi-sdk-comment-p old)) (evilmi-sdk-comment-p (point))) + (goto-char old))) (let* ((tmp (evilmi-sdk-jump-forward-p)) (jump-forward (car tmp)) ;; if ff is not nil, it's jump between quotes