[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit 6fabc1b8e7 048/244: support funtional javascr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit 6fabc1b8e7 048/244: support funtional javascript syntax v1.3.1 |
Date: |
Thu, 6 Jan 2022 02:58:48 -0500 (EST) |
branch: elpa/evil-matchit
commit 6fabc1b8e79265d9b124b71098895919ba070f06
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
support funtional javascript syntax v1.3.1
---
README.org | 4 ++--
...matchit-simple.el => evil-matchit-javascript.el | 24 +++++++++++++---------
evil-matchit-pkg.el | 2 +-
evil-matchit-simple.el | 4 ++--
evil-matchit.el | 15 ++++++++++++--
pkg.sh | 2 +-
6 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/README.org b/README.org
index 0d06a07461..b1737b7cf2 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-matchit (version 1.3.0)
+* evil-matchit (v1.3.1)
Vim [[http://www.vim.org/scripts/script.php?script_id=39][matchit.vim]] by
Benji Fisher ported into Emacs.
@@ -195,4 +195,4 @@ Key points about code quality of plugin:
- support emacs 23
- performance is the first priority
* Contact me
-You can report bugs at [[https://github.com/redguardtoo/evil-matchit]].
\ No newline at end of file
+You can report bugs at [[https://github.com/redguardtoo/evil-matchit]].
diff --git a/evil-matchit-simple.el b/evil-matchit-javascript.el
similarity index 73%
copy from evil-matchit-simple.el
copy to evil-matchit-javascript.el
index 87780ebc9e..5b1ede20cd 100644
--- a/evil-matchit-simple.el
+++ b/evil-matchit-javascript.el
@@ -1,4 +1,4 @@
-;;; evil-matchit-simple.el --- simple match plugin of evil-matchit
+;;; evil-matchit-javascript.el --- simple match plugin of evil-matchit
;; Copyright (C) 2014 Chen Bin <chenbin.sh@gmail.com>
@@ -28,12 +28,13 @@
(require 'evil-matchit)
-(defun evilmi--simple-find-open-brace (cur-line)
+;; TODO, fn.then().({}, find the second (
+(defun evilmi--javascript-find-open-brace (cur-line)
(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))
+ (if (or (string-match "^[ \t]*[\(\}]?[$_a-zA-Z0-9]+.*{ *\\(\/\/.*\\)?$"
cur-line)
+ (string-match "^[ \t]*[\(\}]?[$_a-zA-Z0-9]+.*{
*\\(\/\*[^/]*\*\/\\)?$" cur-line))
(setq rlt 1)
(save-excursion
(forward-line)
@@ -49,17 +50,17 @@
)
;;;###autoload
-(defun evilmi-simple-get-tag ()
+(defun evilmi-javascript-get-tag ()
(let (p
forward-line-num
rlt
(cur-line (buffer-substring-no-properties
(line-beginning-position) (line-end-position)))
)
-
+ (message "evilmi-javascript-get-tag called")
;; only handle open tag
(if (not (memq (following-char) (string-to-list "{[(}}])")))
- (if (setq forward-line-num (evilmi--simple-find-open-brace cur-line))
+ (if (setq forward-line-num (evilmi--javascript-find-open-brace
cur-line))
(when forward-line-num
(setq p (line-beginning-position))
(forward-line (1- forward-line-num))
@@ -75,7 +76,7 @@
)
;;;###autoload
-(defun evilmi-simple-jump (rlt NUM)
+(defun evilmi-javascript-jump (rlt NUM)
(let (cur-line)
(when rlt
(evil-jump-item)
@@ -84,11 +85,14 @@
(line-beginning-position)
(line-end-position)))
;; hack for javascript
- (if (string-match "^[ \t]*})(.*)\; *$" cur-line)
+ (message "cur-line=%s" cur-line)
+ (if (or (string-match "^[ \t]*}\)\(.*\)\; *$" cur-line)
+ (string-match "^[ \t]*}\(.*\))\; *$" cur-line)
+ (string-match "^[ \t]*}\])\; *$" cur-line))
(line-end-position)
(1+ (point))
)
)
))
-(provide 'evil-matchit-simple)
+(provide 'evil-matchit-javascript)
diff --git a/evil-matchit-pkg.el b/evil-matchit-pkg.el
index 51d9291d4c..53bccb9aac 100644
--- a/evil-matchit-pkg.el
+++ b/evil-matchit-pkg.el
@@ -1,2 +1,2 @@
-(define-package "evil-matchit" "1.3.0"
+(define-package "evil-matchit" "1.3.1"
"Vim matchit ported into Emacs (requires EVIL)")
diff --git a/evil-matchit-simple.el b/evil-matchit-simple.el
index 87780ebc9e..c0536833c7 100644
--- a/evil-matchit-simple.el
+++ b/evil-matchit-simple.el
@@ -32,8 +32,8 @@
(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))
+ (if (or (string-match "^[ \t]*[\(\}]?[_a-zA-Z0-9]+.*{ *\\(\/\/.*\\)?$"
cur-line)
+ (string-match "^[ \t]*[\(\}]?[_a-zA-Z0-9]+.*{
*\\(\/\*[^/]*\*\/\\)?$" cur-line))
(setq rlt 1)
(save-excursion
(forward-line)
diff --git a/evil-matchit.el b/evil-matchit.el
index b683f09ca7..5692d2b332 100644
--- a/evil-matchit.el
+++ b/evil-matchit.el
@@ -4,7 +4,7 @@
;; Author: Chen Bin <chenbin.sh@gmail.com>
;; URL: http://github.com/redguardtoo/evil-matchit
-;; Version: 1.3.0
+;; Version: 1.3.1
;; Keywords: matchit vim evil
;; Package-Requires: ((evil "1.0.7"))
;;
@@ -88,7 +88,15 @@
(mapc (lambda (mode)
(plist-put evilmi-plugins mode '((evilmi-simple-get-tag
evilmi-simple-jump)))
)
- '(java-mode js-mode js2-mode javascript-mode perl-mode cperl-mode
go-mode))
+ '(java-mode perl-mode cperl-mode go-mode))
+
+ ;; Javascript
+ (autoload 'evilmi-javascript-get-tag "evil-matchit-javascript" nil)
+ (autoload 'evilmi-javascript-jump "evil-matchit-javascript" nil)
+ (mapc (lambda (mode)
+ (plist-put evilmi-plugins mode '((evilmi-javascript-get-tag
evilmi-javascript-jump)))
+ )
+ '(js-mode js2-mode js3-mode javascript-mode))
;; Html
(autoload 'evilmi-html-get-tag "evil-matchit-html" nil)
@@ -182,6 +190,9 @@
;; need some hook here
))
+;;;###autoload
+(defun evilmi-version() (interactive) (message "1.3.1"))
+
;;;###autoload
(define-minor-mode evil-matchit-mode
"Buffer-local minor mode to emulate matchit.vim"
diff --git a/pkg.sh b/pkg.sh
index 7b009ce253..2e33745f2b 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-pkg=evil-matchit-1.3.0
+pkg=evil-matchit-1.3.1
mkdir $pkg
cp README.org $pkg
cp *.el $pkg
- [nongnu] elpa/evil-matchit dd3d90bf95 010/244: Fix malformed header line, (continued)
- [nongnu] elpa/evil-matchit dd3d90bf95 010/244: Fix malformed header line, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 285f5c2413 024/244: udpated doc and screencast, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit c65da39f49 016/244: autoload sgml-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit b75893af9e 028/244: minor bug in latex-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit acc7efbd8d 034/244: minor bugs fixed v1.2.3, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 78cc0335de 035/244: support latex mode, v1.2.4, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit e81d779541 046/244: support Emacs email (message-mode), ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit f7bced4500 047/244: updated README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 313498e6ec 043/244: #26 jump to percentage, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit bd4feb7884 036/244: support cmake v1.2.5, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 6fabc1b8e7 048/244: support funtional javascript syntax v1.3.1,
ELPA Syncer <=
- [nongnu] elpa/evil-matchit 575e1e652a 037/244: support go-mode v1.2.6, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit d7f45fd142 039/244: updated doc v1.2.7, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4d8d55e7f4 052/244: typo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0b2c287826 053/244: perfect support for ruby-mode v1.3.3 #29, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit b4ae58d214 040/244: some ad on stable, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 04e1d796b9 042/244: support "# ifdef" in c, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 937a407596 058/244: more tolerant algorithm in c/c++ v1.4.2, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 9158dc87cc 062/244: case sensitive code is cleaned because Emacs will handle it, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 1c1a218d34 067/244: sql, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 1017e2e6ec 069/244: README.org: update MELPA URL, ELPA Syncer, 2022/01/06