Skip to content

Commit

Permalink
clean code and fixed ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Bin committed Oct 11, 2023
1 parent f27b2a8 commit fe4cc52
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ clean:
deps:
@mkdir -p deps;
@if [ ! -f deps/evil-1.14.2/evil.el ]; then curl -L https://stable.melpa.org/packages/evil-1.14.2.tar | tar x -C deps/; fi;
@if [ ! -f deps/lua-mode.el ]; then curl -L https://stable.melpa.org/packages/lua-mode-20210802.el > deps/lua-mode.el; fi;
@if [ ! -f deps/markdown-mode.el ]; then curl -L https://stable.melpa.org/packages/markdown-mode-2.5.el > deps/markdown-mode.el; fi;
@if [ ! -f deps/lua-mode.el ]; then curl -L https://raw.githubusercontent.com/immerrr/lua-mode/master/lua-mode.el > deps/lua-mode.el; fi;
@if [ ! -f deps/markdown-mode.el ]; then curl -L https://raw.githubusercontent.com/jrblevin/markdown-mode/master/markdown-mode.el > deps/markdown-mode.el; fi;
@if [ ! -f deps/tuareg-3.0.1/tuareg.el ]; then curl -L https://stable.melpa.org/packages/tuareg-3.0.1.tar | tar x -C deps/; fi;
@if [ ! -f deps/yaml-mode.el ]; then curl -L https://stable.melpa.org/packages/yaml-mode-0.0.15.el > deps/yaml-mode.el; fi;
@if [ ! -f deps/yaml-mode.el ]; then curl -L https://raw.githubusercontent.com/yoshiki/yaml-mode/master/yaml-mode.el > deps/yaml-mode.el; fi;

compile: deps
$(RM) *.elc
Expand Down
2 changes: 1 addition & 1 deletion evil-matchit-ruby.el
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
(("class" "def" "while" "do" "module" "for" "until") () "end" "ENDLESS")))

;;;###autoload
(defun evilmi-ruby-get-tag ()
Expand Down
31 changes: 17 additions & 14 deletions evil-matchit-sdk.el
Original file line number Diff line number Diff line change
Expand Up @@ -282,22 +282,25 @@ If IS-FORWARD is t, jump forward; or else jump backward."
(cur-row-idx (nth 0 cur-tag-info))
(orig-type (nth 1 orig-tag-info))
(cur-type (nth 1 cur-tag-info)))

;; handle function exit point
(when (= 1 level)
;; end tag could be the same
(if (and (evilmi-sdk-strictly-type-p cur-tag-info orig-tag-info)
(not (evilmi-sdk-exactly-same-type-p cur-tag-info orig-tag-info)))
;; just pass
(setq rlt nil)
(cond
((and (< orig-type 2) (= cur-type 2))
(setq rlt (evilmi-sdk-member cur-keyword (nth 2 (nth orig-row-idx match-tags)))))

((and (< cur-type 2) (= orig-type 2))
(setq rlt (evilmi-sdk-member orig-keyword (nth 2 (nth cur-row-idx match-tags)))))

(t
(setq rlt (= (nth 0 orig-tag-info) (nth 0 cur-tag-info)))))))
;; multiple open tags might share the same end tag
(cond
((and (evilmi-sdk-strictly-type-p cur-tag-info orig-tag-info)
(not (evilmi-sdk-exactly-same-type-p cur-tag-info orig-tag-info)))
;; just pass
(setq rlt nil))

((and (< orig-type 2) (= cur-type 2))
(setq rlt (evilmi-sdk-member cur-keyword (nth 2 (nth orig-row-idx match-tags)))))

((and (< cur-type 2) (= orig-type 2))
(setq rlt (evilmi-sdk-member orig-keyword (nth 2 (nth cur-row-idx match-tags)))))

(t
(setq rlt (= (nth 0 orig-tag-info) (nth 0 cur-tag-info))))))

rlt))

;;;###autoload
Expand Down

0 comments on commit fe4cc52

Please sign in to comment.