[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit 23a0576255 213/244: fixed: can not jump tag f
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit 23a0576255 213/244: fixed: can not jump tag from prompt line in shell-mode sometimes |
Date: |
Thu, 6 Jan 2022 02:59:02 -0500 (EST) |
branch: elpa/evil-matchit
commit 23a0576255dbf79af269847b6834ac2341e441fa
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
fixed: can not jump tag from prompt line in shell-mode sometimes
---
evil-matchit-terminal.el | 33 +++++++++++++++++++++++----------
evil-matchit.el | 4 ++--
pkg.sh | 2 +-
3 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/evil-matchit-terminal.el b/evil-matchit-terminal.el
index 210e4c0d4d..c30f0027fc 100644
--- a/evil-matchit-terminal.el
+++ b/evil-matchit-terminal.el
@@ -37,30 +37,43 @@
(require 'evil-matchit-sdk)
(defvar evilmi-terminal-primary-prompt "^\\$ "
- "The primary prompt of terminal")
+ "The primary prompt of terminal.")
(defvar evilmi-terminal-ps1-line-number 1
"The line containing PS1.")
+(defun evilmi-prompt-line-p (&optional position)
+ "If line at POSITION has prompt at the beginning."
+ (let* (rlt)
+ ;; user can't move the cursor to the first column in prompt line
+ (save-excursion
+ (goto-char (or position (point)))
+ (goto-char (line-beginning-position))
+ (setq rlt (> (current-column) 1)))
+
+ ;; another round if we can't decide fromc cusor movement
+ (unless rlt
+ (setq rlt (string-match-p evilmi-terminal-primary-prompt
+ (evilmi-sdk-curline))))
+ rlt))
+
;;;###autoload
(defun evilmi-terminal-get-tag ()
"Get tag at point."
- (let* ((curline (evilmi-sdk-curline))
- (prompt evilmi-terminal-primary-prompt)
- line1
- line2)
+ (let* (nl1 nl2)
(cond
- ((string-match prompt curline)
+ ((evilmi-prompt-line-p)
;; open tag
(list (line-beginning-position) 0))
(t
(save-excursion
(forward-line)
- (setq line1 (evilmi-sdk-curline))
+ (setq nl1 (evilmi-prompt-line-p))
(forward-line)
- (setq line2 (evilmi-sdk-curline)))
- (when (and line1 line2 (or (string-match prompt line1)
- (string-match prompt line2)))
+ (setq nl2 (evilmi-prompt-line-p)))
+ ;; if either of next two lines are prompt line
+ ;; current line is closed tag
+ (when (or nl1 nl2)
(list (line-end-position) 1))))))
;;;###autoload
diff --git a/evil-matchit.el b/evil-matchit.el
index fbef487155..2035d7d27a 100644
--- a/evil-matchit.el
+++ b/evil-matchit.el
@@ -4,7 +4,7 @@
;; Author: Chen Bin <chenbin DOT sh AT gmail DOT com>
;; URL: http://github.com/redguardtoo/evil-matchit
-;; Version: 2.3.8
+;; Version: 2.3.9
;; Keywords: matchit vim evil
;; Package-Requires: ((evil "1.2.0") (emacs "24.4"))
;;
@@ -310,7 +310,7 @@ If IS-INNER is t, the region is inner text object."
(defun evilmi-version()
"Print version."
(interactive)
- (message "2.3.8"))
+ (message "2.3.9"))
(defvar evil-matchit-mode-map (make-sparse-keymap)
"Keymap used by the minor mode.")
diff --git a/pkg.sh b/pkg.sh
index 8df15e6264..553e29fbfe 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,6 +1,6 @@
#!/bin/bash
name=evil-matchit
-version=2.3.8
+version=2.3.9
pkg=$name-$version
mkdir $pkg
cp README.org $pkg
- [nongnu] elpa/evil-matchit fb04ffae4b 176/244: Treat source blocks labelled as "elisp"., (continued)
- [nongnu] elpa/evil-matchit fb04ffae4b 176/244: Treat source blocks labelled as "elisp"., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit b00671fb9e 186/244: Mark evilmi-jump-items as a jump motion, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit ea1e867129 181/244: support more ruby syntax, thanks to @kriansa, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 9ef1325305 200/244: wording, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 86daa28dbd 201/244: doc, minor regex issue, tdd for lua, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 437f67689c 203/244: fix f90-mode bug, add fortran unit test, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 8c8c94bea8 231/244: fixed ci, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 96a1aba323 210/244: Add ocaml tests, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 9cd0ddaacb 233/244: can jump between quotes in plain text, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 539192328e 215/244: fixed minor bug #127, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 23a0576255 213/244: fixed: can not jump tag from prompt line in shell-mode sometimes,
ELPA Syncer <=
- [nongnu] elpa/evil-matchit d701acb054 158/244: Merge pull request #96 from JJPandari/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit cc3654b00d 133/244: only keep fn-end and do-else-end pairs, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 7bee6fad80 167/244: Merge pull request #106 from porras/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit abe43359bf 160/244: Merge pull request #98 from nitros12/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit c5b87b4de5 174/244: Merge pull request #108 from neojski/better-parens-handling, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 5e92e374e6 179/244: better algorithm to match keyword, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 449da5ca10 082/244: fixed typo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 18a3e6ab47 096/244: Merge pull request #64 from hlissner/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 58e735c5ea 097/244: org-element-property exist in 24.4+ only, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit de6ce21e1e 106/244: jump in comment, ELPA Syncer, 2022/01/06