[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit e831d42aa5 085/244: relax regex for python ma
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit e831d42aa5 085/244: relax regex for python matching |
Date: |
Thu, 6 Jan 2022 02:58:52 -0500 (EST) |
branch: elpa/evil-matchit
commit e831d42aa53b2be8172036e735869ea621393f0c
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
relax regex for python matching
---
evil-matchit-python.el | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/evil-matchit-python.el b/evil-matchit-python.el
index 4b9b7161f7..36a6991d5f 100644
--- a/evil-matchit-python.el
+++ b/evil-matchit-python.el
@@ -61,18 +61,17 @@
)
;; extract keyword from current line
- (if (string-match "^[ \t]*\\([a-z]+\\) *.*:$" cur-line)
+ (if (string-match "^[ \t]*\\([a-z]+\\) *.*:\s*\\(#.*\\)?$" cur-line)
(setq keyword (match-string 1 cur-line))
)
(cond
((string= keyword "else")
- (setq regexp "^[ \t]*\\(if\\) *.*:$")
+ (setq regexp "^[ \t]*\\(if\\) *.*:\s*\\(#.*\\)?$")
)
((or (string= keyword "finally") (string= keyword "except"))
- (setq regexp "^[ \t]*\\(try\\) *.*:$")
- )
- )
+ (setq regexp "^[ \t]*\\(try\\) *.*:\s*\\(#.*\\)?$")
+ ))
(when regexp
(save-excursion
@@ -111,13 +110,13 @@
)
(cond
((string= keyword "try")
- (setq regexp "^[ \t]*\\(except\\) *.*:$")
+ (setq regexp "^[ \t]*\\(except\\) *.*:\s*\\(#.*\\)?$")
)
((string= keyword "except")
- (setq regexp "^[ \t]*\\(except\\|finally\\) *.*:$")
+ (setq regexp "^[ \t]*\\(except\\|finally\\) *.*:\s*\\(#.*\\)?$")
)
( (or (string= keyword "elif") (string= keyword "if"))
- (setq regexp "^[ \t]*\\(elif\\|else\\) *.*:$")
+ (setq regexp "^[ \t]*\\(elif\\|else\\) *.*:\s*\\(#.*\\)?$")
)
)
@@ -150,7 +149,7 @@
;;;###autoload
(defun evilmi-python-get-tag ()
(let (rlt
- (regexp "^[ \t]*\\([a-z]+\\) *.*:$")
+ (regexp "^[ \t]*\\([a-z]+\\) *.*:\s*\\(#.*\\)?$")
(cur-line (buffer-substring-no-properties
(line-beginning-position)
(line-end-position)))
- [nongnu] elpa/evil-matchit 4fdcda9fec 056/244: updated README, (continued)
- [nongnu] elpa/evil-matchit 4fdcda9fec 056/244: updated README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 2f8449cfec 057/244: support Laravel Blade Templating, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4fe67764e2 059/244: extra commands to delete/select items v1.4.3, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit d2e7b21038 061/244: remove duplicated code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4efd9e0fac 064/244: use % in evil-visual-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 965efc080a 065/244: updated pkg.sh, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit acb89199d0 074/244: Fix matching chaining off end blocks, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 296c31f93d 073/244: Fix matching multiple arguments and varibles with underscores in do/end blocks., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 9a1b6ac1f9 076/244: can jump between brackets in visual-state #42, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 11352e24ff 083/244: support more pattern in lua-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit e831d42aa5 085/244: relax regex for python matching,
ELPA Syncer <=
- [nongnu] elpa/evil-matchit 3c9d97f3d3 090/244: Merge pull request #60 from robbyoconnor/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 14e23187df 093/244: Put the melpa badges on the same line, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8b80b3df94 098/244: correct inner text-object in python-mode v2.1.2, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 1a5c4454a7 111/244: support verilog, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit ceb13ad1b3 131/244: use more generic when processing C, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit df642d953d 139/244: add a few APIs, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 5ff747a1ef 125/244: When jumping find the first matching keyword in the current line, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 18cf34bc62 150/244: Update evil-matchit-verilog.el, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit f87f03bbf4 169/244: add generic rule to jump between brackets, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 00ab601346 161/244: support "define_method(method) do |*args|", ELPA Syncer, 2022/01/06