[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit 2fc961d94b 122/244: fixed css-mode minor issu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit 2fc961d94b 122/244: fixed css-mode minor issue |
Date: |
Thu, 6 Jan 2022 02:58:55 -0500 (EST) |
branch: elpa/evil-matchit
commit 2fc961d94b27e528df1fc4b88d297dd9af8ed6d6
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
fixed css-mode minor issue
---
evil-matchit-simple.el | 19 +++++++++++--------
evil-matchit.el | 7 +++++++
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/evil-matchit-simple.el b/evil-matchit-simple.el
index 82d5cf6c92..7c924c93eb 100644
--- a/evil-matchit-simple.el
+++ b/evil-matchit-simple.el
@@ -31,18 +31,21 @@
(require 'evil-matchit)
(defun evilmi--simple-find-open-brace (cur-line)
+ (if evilmi-debug (message "evilmi--simple-find-open-brace called =>
cur-line=%s (point)=%d" cur-line (point)))
(let (rlt)
;; javascript code line "(function(...) { ..."
;; C code line "} else {"
- (if (or (string-match "^[ \t]*[\(\}]?[_a-zA-Z0-9]+.*{ *\\(\/\/.*\\)?$"
cur-line)
- (string-match "^[ \t]*[\(\}]?[_a-zA-Z0-9]+.*{
*\\(\/\*[^/]*\*\/\\)?$" cur-line))
- (setq rlt 1)
+ (cond
+ ;; css-mode use characters ".:-"
+ ((or (string-match "^[ \t]*[\(\}]?[.:_a-zA-Z0-9-]+.*{ *\\(\/\/.*\\)?$"
cur-line)
+ (string-match "^[ \t]*[\(\}]?[.:_a-zA-Z0-9-]+.*{
*\\(\/\*[^/]*\*\/\\)?$" cur-line))
+ (setq rlt 1))
+ (t
(save-excursion
(forward-line)
(setq cur-line (evilmi-sdk-curline))
(if (string-match "^[ \t]*{ *$" cur-line)
- (setq rlt 2))
- ))
+ (setq rlt 2)))))
rlt))
;;;###autoload
@@ -53,7 +56,7 @@
(ch (if tmp (car tmp)))
rlt)
- (if evilmi-debug (message "evilmi-simple-get-tag called => %s" ch))
+ (if evilmi-debug (message "evilmi-simple-get-tag called => ch=%s
(point)=%d" ch (point)))
(cond
;; In evil-visual-state, the (preceding-char) is actually the character
under cursor
@@ -75,7 +78,7 @@
;;;###autoload
(defun evilmi-simple-jump (rlt NUM)
(when rlt
- (if evilmi-debug (message "evilmi-simple-jump called"))
+ (if evilmi-debug (message "evilmi-simple-jump called (point)=%d" (point)))
;; In latex-mode `scan-sexps' does NOT work properly between "[]"
;; so we have to fallback to evil's API.
@@ -84,7 +87,7 @@
(evilmi--simple-jump))
;; hack for javascript
- (if (string-match "^[ \t]*})\\((.*)\\)?\; *$"
+ (if (string-match-p "^[ \t]*})\\((.*)\\)?\; *$"
(evilmi-sdk-curline))
(line-end-position)
(1+ (point)))))
diff --git a/evil-matchit.el b/evil-matchit.el
index 1c1899261d..1a26e7b92f 100644
--- a/evil-matchit.el
+++ b/evil-matchit.el
@@ -99,6 +99,7 @@ Set this flag into `t' to always use simple jump.")
(defun evilmi--is-jump-forward ()
"Return: (forward-direction font-face-under-cursor character-under-cursor).
If font-face-under-cursor is NOT nil, the quoted string is being processed."
+ (if evilmi-debug (message "evilmi--is-jump-forward called"))
(let* ((tmp (evilmi--get-char-under-cursor))
(ch (car tmp))
(p (cadr tmp))
@@ -130,6 +131,9 @@ If font-face-under-cursor is NOT nil, the quoted string is
being processed."
fontfaces))))
(defun evilmi--scan-sexps (is-forward)
+ "Get the position of matching tag.
+If IS-FORWARD is t, jump forward; or else jump backward."
+ (if evilmi-debug (message "evilmi--scan-sexps called => %s" is-forward))
(let* ((start-pos (if is-forward (point) (+ 1 (point))))
(arg (if is-forward 1 -1))
(limit (if is-forward (point-max) (point-min)))
@@ -209,6 +213,7 @@ If font-face-under-cursor is NOT nil, the quoted string is
being processed."
;; @see
http://emacs.stackexchange.com/questions/13222/a-elisp-function-to-jump-between-matched-pair
(defun evilmi--find-position-to-jump (ff is-forward ch)
+ (if evilmi-debug (message "evilmi--find-position-to-jump called => %s %s %s
%d" ff is-forward ch (point)))
"Non-nil ff means jumping between quotes"
(let* ((rlt (if ff (evilmi--find-the-other-quote-char ff is-forward ch)
(evilmi--scan-sexps is-forward))))
@@ -225,6 +230,7 @@ If font-face-under-cursor is NOT nil, the quoted string is
being processed."
(defun evilmi--simple-jump ()
"Alternative for evil-jump-item."
(interactive)
+ (if evilmi-debug (message "evilmi--simple-jump called (point)=%d" (point)))
(let* ((tmp (evilmi--is-jump-forward))
(jump-forward (car tmp))
;; if ff is not nil, it's jump between quotes
@@ -235,6 +241,7 @@ If font-face-under-cursor is NOT nil, the quoted string is
being processed."
(evilmi--tweak-selected-region ff jump-forward)))
(defun evilmi--operate-on-item (num &optional FUNC)
+ (if evilmi-debug (message "evilmi--operate-on-item called => %s (point)=%d"
num (point)))
(let* ((plugin (plist-get evilmi-plugins major-mode))
rlt
jumped
- [nongnu] elpa/evil-matchit 8b71b42603 041/244: better support for sh and c/c++ v1.2.8, (continued)
- [nongnu] elpa/evil-matchit 8b71b42603 041/244: better support for sh and c/c++ v1.2.8, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4846518b59 109/244: support rjsx-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0b0e6d61a6 119/244: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8a10046f25 145/244: fix python issue, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0d62d497d1 143/244: Fix typo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4435f3ada5 128/244: evil-matchit-org: add :results: :end: drawer, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit a91ea21c4a 141/244: Fix typo in readme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit fb5807c096 129/244: Merge pull request #82 from et2010/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4f3928db11 157/244: let evil-repeat ignore evilmi jump, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 43be86d8c4 171/244: support css-in-js styled components, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 2fc961d94b 122/244: fixed css-mode minor issue,
ELPA Syncer <=
- [nongnu] elpa/evil-matchit 2001c5be5f 147/244: ocaml: improve validation of keywords, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8fa4c1390d 163/244: can change shortcut from "%" to "m", ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 665751dff8 165/244: Ignore trailing space in Ruby blocks with arguments, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 848dc06902 183/244: clean code&do, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 1027459d44 180/244: more torelant to ruby syntax, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit d75d41d7b3 197/244: add unit test for c, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 25ad66d397 190/244: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 289982cbee 192/244: doc, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 9b228b097a 242/244: easier to add own rules, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 3417dbb275 117/244: Add ocaml support, ELPA Syncer, 2022/01/06