branch: elpa/evil-matchit commit 8fba4f12e1bbfdbf25a8ed2a5308840f104bc7c0 Author: Chen Bin <chenbin...@gmail.com> Commit: Chen Bin <chenbin...@gmail.com>
minor issue in emacs lisp comment --- evil-matchit-sdk.el | 6 +++--- evil-matchit.el | 4 ++-- pkg.sh | 2 +- tests/evil-matchit-tests.el | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/evil-matchit-sdk.el b/evil-matchit-sdk.el index 1ca71c2bdc..c3bde55711 100644 --- a/evil-matchit-sdk.el +++ b/evil-matchit-sdk.el @@ -103,11 +103,10 @@ If IS-FORWARD is t, jump forward; or else jump backward." ((evilmi-sdk-comment-p (point)) ;; Matching tag in comment. ;; Use own algorithm instead of `scan-sexps' - ;; because `scan-sexps' not work in some major-mode + ;; because `scan-sexps' does not work in some major modes (save-excursion (setq start-pos (point)) - (while (and (not (= start-pos limit)) - (> lvl 0)) + (while (and e (not (= start-pos limit)) (> lvl 0)) (goto-char (setq start-pos (+ start-pos arg))) (when (evilmi-sdk-comment-p start-pos) (cond @@ -117,6 +116,7 @@ If IS-FORWARD is t, jump forward; or else jump backward." (setq lvl (1- lvl)))))) (when (= lvl 0) (setq rlt (+ start-pos (if is-forward 1 0)))))) + (t ;; not comment ;; search but ignore comments diff --git a/evil-matchit.el b/evil-matchit.el index 107a2b27ff..fbef487155 100644 --- a/evil-matchit.el +++ b/evil-matchit.el @@ -4,7 +4,7 @@ ;; Author: Chen Bin <chenbin DOT sh AT gmail DOT com> ;; URL: http://github.com/redguardtoo/evil-matchit -;; Version: 2.3.7 +;; Version: 2.3.8 ;; Keywords: matchit vim evil ;; Package-Requires: ((evil "1.2.0") (emacs "24.4")) ;; @@ -310,7 +310,7 @@ If IS-INNER is t, the region is inner text object." (defun evilmi-version() "Print version." (interactive) - (message "2.3.7")) + (message "2.3.8")) (defvar evil-matchit-mode-map (make-sparse-keymap) "Keymap used by the minor mode.") diff --git a/pkg.sh b/pkg.sh index 37a74b3bf4..8df15e6264 100755 --- a/pkg.sh +++ b/pkg.sh @@ -1,6 +1,6 @@ #!/bin/bash name=evil-matchit -version=2.3.7 +version=2.3.8 pkg=$name-$version mkdir $pkg cp README.org $pkg diff --git a/tests/evil-matchit-tests.el b/tests/evil-matchit-tests.el index feebc6cede..2a97c926e2 100644 --- a/tests/evil-matchit-tests.el +++ b/tests/evil-matchit-tests.el @@ -408,5 +408,29 @@ (should (eq major-mode 'markdown-mode)))) +(ert-deftest evilmi-test-emacs-lisp () + (with-temp-buffer + (insert ";; test1\n" + ";; {{\n" + ";; java\n" + ";; }}\n" + "test\n") + (emacs-lisp-mode) + (font-lock-ensure) + + (goto-char (point-min)) + (forward-char 2) + (evilmi-jump-items) + ;; still at the same line if there is no bracket at point + (should (string= ";; test1" (evilmi-sdk-curline))) + ;; test matched brackets + (search-forward "{") + (evilmi-jump-items) + (should (string= ";; }}" (evilmi-sdk-curline))) + (evilmi-jump-items) + (should (string= ";; {{" (evilmi-sdk-curline))) + + (should (eq major-mode 'emacs-lisp-mode)))) + (ert-run-tests-batch-and-exit) ;;; evil-matchit-tests.el ends here