From a88146b6000615816dbc04c4315e077d518b1eb9 Mon Sep 17 00:00:00 2001 From: Chen Bin Date: Tue, 21 Oct 2014 21:53:27 +1100 Subject: [PATCH] fixed: minor bug comment to the line v1.5.7 --- README.org | 2 +- evil-nerd-commenter-pkg.el | 2 +- evil-nerd-commenter.el | 17 +++++++++++------ pkg.sh | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.org b/README.org index f96c245..786dcdf 100644 --- a/README.org +++ b/README.org @@ -1,4 +1,4 @@ -* evil-nerd-commenter (v1.5.6) +* evil-nerd-commenter (v1.5.7) *This program could be used independently WITHOUT evil-mode!* diff --git a/evil-nerd-commenter-pkg.el b/evil-nerd-commenter-pkg.el index 881a224..d244017 100644 --- a/evil-nerd-commenter-pkg.el +++ b/evil-nerd-commenter-pkg.el @@ -1,2 +1,2 @@ -(define-package "evil-nerd-commenter" "1.5.6" +(define-package "evil-nerd-commenter" "1.5.7" "Comment/uncomment lines efficiently. Like Nerd Commenter in Vim") diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el index 540b681..1be7ed0 100644 --- a/evil-nerd-commenter.el +++ b/evil-nerd-commenter.el @@ -4,7 +4,7 @@ ;; Author: Chen Bin ;; URL: http://github.com/redguardtoo/evil-nerd-commenter -;; Version: 1.5.6 +;; Version: 1.5.7 ;; Keywords: commenter vim line evil ;; ;; This file is not part of GNU Emacs. @@ -308,11 +308,16 @@ (defun evilnc--find-dst-line-num (UNITS) (let ((cur-line-num (evilnc--current-line-num)) - dst-line-num) - (if (>= (mod cur-line-num 10) UNITS) - (setq UNITS (+ UNITS 10)) + dst-line-num + (r 1) + (l (length (number-to-string UNITS)))) + (while (> l 0) + (setq r (* r 10)) + (setq l (- l 1))) + (if (>= (mod cur-line-num r) UNITS) + (setq UNITS (+ UNITS r)) ) - (setq dst-line-num (+ cur-line-num (- UNITS (mod cur-line-num 10)))) + (setq dst-line-num (+ cur-line-num (- UNITS (mod cur-line-num r)))) )) ;; ==== below this line are public commands @@ -494,7 +499,7 @@ or 'C-u 3 M-x evilnc-quick-comment-or-uncomment-to-the-line' to comment to the l ;;;###autoload (defun evilnc-version () (interactive) - (message "1.5.6")) + (message "1.5.7")) ;;;###autoload (defun evilnc-default-hotkeys () diff --git a/pkg.sh b/pkg.sh index d711433..e596f31 100755 --- a/pkg.sh +++ b/pkg.sh @@ -1,5 +1,5 @@ #!/bin/bash -pkg=evil-nerd-commenter-1.5.6 +pkg=evil-nerd-commenter-1.5.7 mkdir $pkg cp README.org $pkg cp *.el $pkg