[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit c4be28092f 087/244: perfect support for visua
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit c4be28092f 087/244: perfect support for visual-line state v2.1 |
Date: |
Thu, 6 Jan 2022 02:58:52 -0500 (EST) |
branch: elpa/evil-matchit
commit c4be28092f2d03e37a6fd194f2098e5e8fe254ae
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
perfect support for visual-line state v2.1
---
README.org | 7 +++---
evil-matchit-pkg.el | 2 +-
evil-matchit.el | 60 +++++++++++++++++-----------------------------------
pkg.sh | 2 +-
screencast.gif | Bin 318351 -> 318349 bytes
5 files changed, 25 insertions(+), 46 deletions(-)
diff --git a/README.org b/README.org
index db5a062599..90b71dd613 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-matchit (v2.0.2)
+* evil-matchit (v2.1)
Vim [[http://www.vim.org/scripts/script.php?script_id=39][matchit.vim]] by
Benji Fisher ported into Emacs.
@@ -31,7 +31,8 @@ Tested on Emacs 23.4, 24.3, 24.4
* Why use evil-matchit
- No learning curve. Press "%" to jump. That's all!
-- Stable! Though it's dependent on evil-mode, NO evil-mode API is used
+- Stable. Usage of Evil API is minimized
+- Perfect integration with Evil
- Support any modern languages (html/java/c/c++/python/latex/javascript ...)
- Powerful. If you mix jsp, freemarker, html, jquery template or any weird
syntax into one file, it still works!
- Extendable. Write a plugin for it takes only 5 minutes
@@ -248,7 +249,7 @@ Basically you just need:
#+END_SRC
** Share your code to the world
-Tweak your code a little bit to make it a plugin and ask me to merge it into
upstream.
+Convert your code to a plugin and ask me to merge it into upstream.
Please check "evil-matchit-latex.el" for technical details about plugin.
diff --git a/evil-matchit-pkg.el b/evil-matchit-pkg.el
index 5ea93698bc..014b95979a 100644
--- a/evil-matchit-pkg.el
+++ b/evil-matchit-pkg.el
@@ -1,2 +1,2 @@
-(define-package "evil-matchit" "2.0.2"
+(define-package "evil-matchit" "2.1"
"Vim matchit ported into Emacs (requires EVIL)")
diff --git a/evil-matchit.el b/evil-matchit.el
index 7f82b6f3db..3d32a41519 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: 2.0.2
+;; Version: 2.1
;; Keywords: matchit vim evil
;; Package-Requires: ((evil "1.0.7"))
;;
@@ -85,17 +85,10 @@ If this flag is nil, then 50 means jump 50 times.")
ch))
(defun evilmi--get-char-under-cursor ()
- "Return: (previous-character current-character position)"
+ "Return: (character position)"
(let (ch p)
- (cond
- ;; evil load
- ((eq evil-state 'visual)
- ;; (preceding-char) (following-char) are written in C
- (setq ch (preceding-char))
- (setq p (- (point) 1)))
- (t
- (setq ch (following-char))
- (setq p (point))))
+ (setq ch (following-char))
+ (setq p (point))
(if evilmi-debug (message "evilmi--get-char-under-cursor called. Return:
(%d %s)" ch p))
(list ch p)))
@@ -129,23 +122,15 @@ If font-face-under-cursor is NOT nil, the quoted string
is being processed"
(let (rlt
start-pos
(arg (if is-forward 1 -1)))
- (cond
- ((eq evil-state 'visual)
- (setq start-pos (if is-forward (- (point) 1)
- (point))))
- (t
- ;; normal state and other state
- (setq start-pos (if is-forward (point) (+ 1 (point))))
- ))
+ ;; normal state and other state
+ (setq start-pos (if is-forward (point) (+ 1 (point))))
(setq rlt (scan-sexps start-pos arg))
(if evilmi-debug (message "evilmi--scan-sexps called. Return: %s" rlt))
rlt))
(defun evilmi--adjust-quote-jumpto (is-forward pos)
(let (rlt)
- (if (eq evil-state 'visual)
- (setq rlt (if is-forward (- pos 1) pos (+ 1 pos)))
- (setq rlt (if is-forward pos (+ 1 pos))))
+ (setq rlt (if is-forward pos (+ 1 pos)))
(if evilmi-debug (message "evilmi--adjust-quote-jumpto called. Return: %s"
rlt))
rlt))
@@ -172,12 +157,9 @@ If font-face-under-cursor is NOT nil, the quoted string is
being processed"
rlt))
(defun evilmi--adjust-jumpto (is-forward rlt)
- (cond
- ((eq evil-state 'visual)
- (if is-forward (setq rlt (+ rlt 1)))
- )
- (t
- (if is-forward (setq rlt (- rlt 1)))))
+ ;; normal-state hack!
+ (unless (eq evil-state 'visual)
+ (if is-forward (setq rlt (- rlt 1))))
(if evilmi-debug (message "evilmi--adjust-jumpto called. Return: %s" rlt))
rlt)
@@ -192,18 +174,11 @@ If font-face-under-cursor is NOT nil, the quoted string
is being processed"
rlt))
(defun evilmi--tweak-selected-region-finally (ff jump-forward)
- (if (eq evil-state 'visual)
- (cond
- (jump-forward
- ;; if ff is non-nil, I control the jump flow from character level,
- ;; so hack to workaround scan-sexps is NOT necessary
- (unless ff
- (evil-backward-char)))
- (t
- (exchange-point-and-mark)
- (evil-forward-char)
- (exchange-point-and-mark)))
- ))
+ ;; visual-state hack!
+ (if (and jump-forward (eq evil-state 'visual) (not ff))
+ ;; if ff is non-nil, I control the jump flow from character level,
+ ;; so hack to workaround scan-sexps is NOT necessary
+ (evil-backward-char)))
(defun evilmi--simple-jump ()
"Alternative for evil-jump-item"
@@ -459,12 +434,15 @@ If font-face-under-cursor is NOT nil, the quoted string
is being processed"
))
;;;###autoload
-(defun evilmi-version() (interactive) (message "2.0.2"))
+(defun evilmi-version() (interactive) (message "2.1"))
;;;###autoload
(define-minor-mode evil-matchit-mode
"Buffer-local minor mode to emulate matchit.vim"
:keymap (make-sparse-keymap)
+ ;; get correct value of `(point)` in visual-line mode
+ ;; @see
https://bitbucket.org/lyro/evil/issues/540/get-the-char-under-cusor-in-visual-line
+ (evil-set-command-property 'evilmi-jump-items :keep-visual t)
(if (fboundp 'evilmi-customize-keybinding)
;; use user's own key bindings
(evilmi-customize-keybinding)
diff --git a/pkg.sh b/pkg.sh
index 561a6b3657..d89bba376e 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-pkg=evil-matchit-2.0.2
+pkg=evil-matchit-2.1
mkdir $pkg
cp README.org $pkg
cp *.el $pkg
diff --git a/screencast.gif b/screencast.gif
index baf5b0efdf..e50def58d1 100644
Binary files a/screencast.gif and b/screencast.gif differ
- [nongnu] elpa/evil-matchit 0b2c287826 053/244: perfect support for ruby-mode v1.3.3 #29, (continued)
- [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
- [nongnu] elpa/evil-matchit 3f08492ec4 072/244: FIXED: #43 no jump at the first line in html v1.5.2, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit bfe8afe2a1 070/244: Merge pull request #40 from xuchunyang/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 257d4ab10c 071/244: #41 workaround web-mode v11 issue, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit c4be28092f 087/244: perfect support for visual-line state v2.1,
ELPA Syncer <=
- [nongnu] elpa/evil-matchit 4780ef4e4a 104/244: scan-sexps buggy in latex-mode, fallback to Evil API, ELPA Syncer, 2022/01/06
- [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