[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit 9a1b6ac1f9 076/244: can jump between brackets
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit 9a1b6ac1f9 076/244: can jump between brackets in visual-state #42 |
Date: |
Thu, 6 Jan 2022 02:58:51 -0500 (EST) |
branch: elpa/evil-matchit
commit 9a1b6ac1f9fc12a31a1439c1e5ebca334187f8de
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
can jump between brackets in visual-state #42
---
evil-matchit-simple.el | 37 +++++++++++++++++++------------------
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/evil-matchit-simple.el b/evil-matchit-simple.el
index 1a123a4790..5da3e45c04 100644
--- a/evil-matchit-simple.el
+++ b/evil-matchit-simple.el
@@ -40,10 +40,8 @@
(setq cur-line (buffer-substring-no-properties
(line-beginning-position) (line-end-position)))
(if (string-match "^[ \t]*{ *$" cur-line)
- (setq rlt 2)
- )
- )
- )
+ (setq rlt 2))
+ ))
rlt))
;;;###autoload
@@ -53,21 +51,24 @@
rlt
(cur-line (buffer-substring-no-properties
(line-beginning-position) (line-end-position)))
- )
+ (tag-chars (string-to-list "{[(}}])")))
- ;; only handle open tag
- (if (not (memq (following-char) (string-to-list "{[(}}])")))
- (if (setq forward-line-num (evilmi--simple-find-open-brace cur-line))
- (when forward-line-num
- (setq p (line-beginning-position))
- (forward-line (1- forward-line-num))
- (search-forward "{" nil nil)
- (backward-char)
- (setq rlt (list p))
- )
- )
- (setq rlt (list (point)))
- )
+ ;; Only handle open tag
+ (cond
+ ;; In evil-visual-state, the (preceding-char) is actually the character
under cursor
+ ((and (not (memq (following-char) tag-chars))
+ (not (memq (preceding-char) tag-chars)))
+ (if (setq forward-line-num (evilmi--simple-find-open-brace cur-line))
+ (when forward-line-num
+ (setq p (line-beginning-position))
+ (forward-line (1- forward-line-num))
+ (search-forward "{" nil nil)
+ (backward-char)
+ (setq rlt (list p))
+ )))
+ (t
+ ;; use evil's own evil-jump-item
+ (setq rlt (list (point)))))
rlt))
;;;###autoload
- [nongnu] elpa/evil-matchit 38df050735 103/244: clean code, (continued)
- [nongnu] elpa/evil-matchit 38df050735 103/244: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0941f38bfe 118/244: Add ocaml plugin to evil-matchit.el, ELPA Syncer, 2022/01/06
- [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 <=
- [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, 2022/01/06
- [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