diff --git a/evil-matchit-ruby.el b/evil-matchit-ruby.el index 364d4f4..dc96bfc 100644 --- a/evil-matchit-ruby.el +++ b/evil-matchit-ruby.el @@ -48,7 +48,7 @@ '((("unless" "if") ("elsif" "else") "end") ("begin" ("rescue" "ensure") "end") ("case" ("when" "else") "end") - (("class" "def" "while" "do" "module" "for" "until") () "end" "ENDLESS"))) + (("class" "def" "while" "do" "module" "for" "until") () "end" "SAME-INDENT"))) ;;;###autoload (defun evilmi-ruby-get-tag () diff --git a/evil-matchit-sdk.el b/evil-matchit-sdk.el index 443b7b1..2ff87c9 100644 --- a/evil-matchit-sdk.el +++ b/evil-matchit-sdk.el @@ -271,6 +271,14 @@ If IS-FORWARD is t, jump forward; or else jump backward." (goto-char dst) (evilmi-sdk-tweak-selected-region ff jump-forward)))) +;; @see https://github.com/redguardtoo/evil-matchit/issues/143 +;; need record indent info into tag-info +(defun evilmi-sdk-same-indent-p (tag-info) + (and (nth 2 tag-info) (string= (nth 2 tag-info) "SAME-INDENT"))) + +(defun evilmi-sdk-monogamy-p (tag-info) + (and (nth 2 tag-info) (string= (nth 2 tag-info) "MONOGAMY"))) + (defun evilmi-sdk-strictly-type-p (crt orig) (or (evilmi-sdk-monogamy-p crt) (evilmi-sdk-monogamy-p orig))) @@ -283,6 +291,14 @@ If IS-FORWARD is t, jump forward; or else jump backward." (orig-type (nth 1 orig-tag-info)) (cur-type (nth 1 cur-tag-info))) + (when evilmi-debug + (message "evilmi-sdk-tags-matched-p called. level=%s orig-keyword=%s cur-keyword=%s cur-tag-info=%s orig-tag-info=%s" + level + orig-keyword + cur-keyword + cur-tag-info + orig-tag-info)) + ;; handle function exit point (when (= 1 level) ;; multiple open tags might share the same end tag @@ -403,9 +419,6 @@ Rule is looked up in HOWTOS." (line-beginning-position) (line-end-position))))) -(defun evilmi-sdk-monogamy-p (tag-info) - (and (nth 2 tag-info) (string= (nth 2 tag-info) "MONOGAMY"))) - (defun evilmi-sdk-exactly-same-type-p (crt orig) (eq (nth 0 crt) (nth 0 orig)))