[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit c04f8f480c 164/244: Match Ruby's begin also w
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit c04f8f480c 164/244: Match Ruby's begin also when it's not on the beginning of the line |
Date: |
Thu, 6 Jan 2022 02:58:58 -0500 (EST) |
branch: elpa/evil-matchit
commit c04f8f480cbb39842376c5f93472f67f44ee1637
Author: Sergio Gil PĂ©rez de la Manga <sgilperez@gmail.com>
Commit: GitHub <noreply@github.com>
Match Ruby's begin also when it's not on the beginning of the line
This is a common idiom in Ruby (e.g.
https://www.justinweiss.com/articles/4-simple-memoization-patterns-in-ruby-and-one-gem/#multi-line-memoization;
it's even enforced by the popular Rubocop style checker:
https://rubocop.readthedocs.io/en/stable/cops_style/#stylemultilinememoization)
but it confuses evil-matchit:
```ruby
class C
def m # evil-matchit keeps jumping between here
@v ||= begin
blah
end # and here
end
end
```
Since no regular expression matches, evil-matchit skips the `begin` and
matches the wrong `end`.
This change seems to fix it, but I'm not sure at all that it's the right
way. Please consider this more a bug report with a proof of concept more than a
pull request, you can probably find a better fix :smile_cat:
---
evil-matchit-ruby.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/evil-matchit-ruby.el b/evil-matchit-ruby.el
index 45a0bf21a2..9bc408afa5 100644
--- a/evil-matchit-ruby.el
+++ b/evil-matchit-ruby.el
@@ -36,6 +36,7 @@
("^[ \t]*\\([a-z]+\\)\\( .*\\| *\\)$" 1)
("^.* \\(do\\) |[a-z0-9A-Z_, *]+|$" 1)
("^.* \\(do\\) *$" 1)
+ ("^.* \\(begin\\) *$" 1)
("^.* \\(end\\)\\..*$" 1)))
(defvar evilmi-ruby-match-tags
- [nongnu] elpa/evil-matchit de6ce21e1e 106/244: jump in comment, (continued)
- [nongnu] elpa/evil-matchit de6ce21e1e 106/244: jump in comment, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 3873a93653 081/244: support enh-ruby-mode, more tips v2.0.1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 2f423258e1 152/244: support mhtml-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4a24de3862 126/244: Add copyright preamble, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 73bef5fb56 134/244: Merge pull request #84 from dsdshcym/83-elixir-support, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8123eef094 146/244: Merge pull request #88 from Khady/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 3f49ee9d17 140/244: improve ocaml, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8d6bd9187d 154/244: [chen] update doc, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 2143844e2b 170/244: support js2-jsx-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit e941c695f3 173/244: Add [ and { as well., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit c04f8f480c 164/244: Match Ruby's begin also when it's not on the beginning of the line,
ELPA Syncer <=
- [nongnu] elpa/evil-matchit d779aedaf1 195/244: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit dead63c7d0 194/244: add unit test, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 80dc731ab7 237/244: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0be04f960f 049/244: use text objects v1.3.2, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 62cef4f91a 077/244: replace evil-jump-items v2.0, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 6390e9e06c 216/244: Silence byte-compiler, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit ae8fddea39 207/244: clean code, tdd for markdown, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0fd65c463b 226/244: clean code&doc, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit ceec6a63b0 236/244: better algorithm to match bracket/brace in javascript, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8c4f516265 238/244: Support matlab-mode, ELPA Syncer, 2022/01/06