branch: elpa/evil-matchit
commit 8b80b3df9472217d55962981025539f2da603296
Author: Chen Bin <[email protected]>
Commit: Chen Bin <[email protected]>

    correct inner text-object in python-mode v2.1.2
---
 README.org             |  2 +-
 evil-matchit-pkg.el    |  2 +-
 evil-matchit-python.el | 28 ++++++++++------------------
 evil-matchit.el        |  7 ++++---
 pkg.sh                 |  2 +-
 5 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/README.org b/README.org
index a673512a6a..1b13cb0bf7 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-matchit (v2.1.1)
+* evil-matchit (v2.1.2)
 
 
[[http://melpa.org/#/evil-matchit][file:http://melpa.org/packages/evil-matchit-badge.svg]]
 
[[http://stable.melpa.org/#/evil-matchit][file:http://stable.melpa.org/packages/evil-matchit-badge.svg]]
 
diff --git a/evil-matchit-pkg.el b/evil-matchit-pkg.el
index 8ea0d00a1e..852808303e 100644
--- a/evil-matchit-pkg.el
+++ b/evil-matchit-pkg.el
@@ -1,2 +1,2 @@
-(define-package "evil-matchit" "2.1.1"
+(define-package "evil-matchit" "2.1.2"
                 "Vim matchit ported into Emacs (requires EVIL)")
diff --git a/evil-matchit-python.el b/evil-matchit-python.el
index daddfcb818..bc0dea1b71 100644
--- a/evil-matchit-python.el
+++ b/evil-matchit-python.el
@@ -43,9 +43,7 @@
               (/ (length prefix) 4)
               )
             )
-        0
-        )
-      )
+        0))
     ))
 
 ;; jump from else to if, jump from finally to try
@@ -57,13 +55,11 @@
         regexp
         (cur-line (buffer-substring-no-properties
                    (line-beginning-position)
-                   (line-end-position)))
-        )
+                   (line-end-position))))
 
     ;; extract keyword from current line
     (if (string-match "^[ \t]*\\([a-z]+\\) *.*:\s*\\(#.*\\)?$" cur-line)
-        (setq keyword (match-string 1 cur-line))
-      )
+        (setq keyword (match-string 1 cur-line)))
 
     (cond
      ((string= keyword "else")
@@ -96,18 +92,16 @@
         )
       (when where-to-go
         (goto-char where-to-go)
-        (skip-chars-forward " \t")
-        )
+        (skip-chars-forward " \t"))
       )
-    )
-  )
+    ))
 
 (defun evilmi--python-move-to-next-open-tag (keyword cur-indent)
   (let (out-of-loop
         where-to-go
         regexp
-        cur-line
-        )
+        cur-line)
+
     (cond
      ((string= keyword "try")
       (setq regexp "^[ \t]*\\(except\\) *.*:\s*\\(#.*\\)?$")
@@ -115,10 +109,9 @@
      ((string= keyword "except")
       (setq regexp "^[ \t]*\\(except\\|finally\\) *.*:\s*\\(#.*\\)?$")
       )
-     ( (or (string= keyword "elif") (string= keyword "if"))
+     ((or (string= keyword "elif") (string= keyword "if"))
        (setq regexp "^[ \t]*\\(elif\\|else\\) *.*:\s*\\(#.*\\)?$")
-       )
-     )
+       ))
 
     (save-excursion
       (while (not out-of-loop)
@@ -143,8 +136,7 @@
       (goto-char where-to-go)
       (skip-chars-forward " \t")
       )
-    )
-  )
+    ))
 
 ;;;###autoload
 (defun evilmi-python-get-tag ()
diff --git a/evil-matchit.el b/evil-matchit.el
index 4f45932572..6b1fe59daa 100644
--- a/evil-matchit.el
+++ b/evil-matchit.el
@@ -4,7 +4,7 @@
 
 ;; Author: Chen Bin <[email protected]>
 ;; URL: http://github.com/redguardtoo/evil-matchit
-;; Version: 2.1.1
+;; Version: 2.1.2
 ;; Keywords: matchit vim evil
 ;; Package-Requires: ((evil "1.0.7"))
 ;;
@@ -359,7 +359,8 @@ If font-face-under-cursor is NOT nil, the quoted string is 
being processed"
           )))
 
       ;; for inner text object, backward a line at the end
-      (when is-inner
+      ;; but in python-mode, last line is also code line
+      (when (and is-inner (not (eq major-mode 'python-mode)))
         (goto-char e)
         (forward-line -1)
         (setq e (line-end-position)))
@@ -435,7 +436,7 @@ If font-face-under-cursor is NOT nil, the quoted string is 
being processed"
    ))
 
 ;;;###autoload
-(defun evilmi-version() (interactive) (message "2.1.1"))
+(defun evilmi-version() (interactive) (message "2.1.2"))
 
 ;;;###autoload
 (define-minor-mode evil-matchit-mode
diff --git a/pkg.sh b/pkg.sh
index 91c07c779f..966e6488c6 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-pkg=evil-matchit-2.1.1
+pkg=evil-matchit-2.1.2
 mkdir $pkg
 cp README.org $pkg
 cp *.el $pkg

Reply via email to