branch: elpa/evil-nerd-commenter
commit 10dd7f8f1d32584695109753c22816cdb94c7b78
Merge: 20a242a085 c2d8cd947e
Author: Chen Bin <[email protected]>
Commit: Chen Bin <[email protected]>
Merge branch 'tuhdo-master'
* tuhdo-master:
remove some interacitve hint and fixed some bug
Prompt user for input and fix evilnc-kill-to-line
---
evil-nerd-commenter.el | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index 8e6dfd9abb..ca000d2fc3 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -341,7 +341,7 @@ Paragraphs are separated by empty lines."
;;;###autoload
(defun evilnc-comment-or-uncomment-to-the-line (&optional LINENUM)
"Comment or uncomment from the current line to the LINENUM line"
- (interactive "p")
+ (interactive "nLine: ")
(if (not (region-active-p))
(let ((b (line-beginning-position))
(e (line-end-position)))
@@ -415,10 +415,7 @@ or 'C-u 3 M-x
evilnc-quick-comment-or-uncomment-to-the-line' to comment to the l
Case 1: If no region selected, operate on current line. if NUM>1,
comment/uncomment
extra N-1 lines from next line
Case 2: If a region selected, the region is expand to make sure the region
contain
- whole lines. Then we operate the expanded region. NUM is ignored.
-"
- (interactive "p")
-
+ whole lines. Then we operate the expanded region. NUM is ignored."
;; support negative number
(when (< NUM 0)
(forward-line (1+ NUM))
@@ -439,7 +436,7 @@ or 'C-u 3 M-x
evilnc-quick-comment-or-uncomment-to-the-line' to comment to the l
;;;###autoload
(defun evilnc-copy-to-line (&optional LINENUM)
"Copy from the current line to the LINENUM line, for non-evil user only"
- (interactive "p")
+ (interactive "nCopy to line: ")
(if (not (region-active-p))
(let ((b (line-beginning-position))
(e (line-end-position)))
@@ -455,7 +452,7 @@ or 'C-u 3 M-x
evilnc-quick-comment-or-uncomment-to-the-line' to comment to the l
;;;###autoload
(defun evilnc-kill-to-line (&optional LINENUM)
"Kill from the current line to the LINENUM line, for non-evil user only"
- (interactive "p")
+ (interactive "NKill to line: ")
(if (not (region-active-p))
(let ((b (line-beginning-position))
(e (line-end-position)))
@@ -465,7 +462,10 @@ or 'C-u 3 M-x
evilnc-quick-comment-or-uncomment-to-the-line' to comment to the l
(setq b (line-beginning-position)))
(if (> (line-end-position) e)
(setq e (line-end-position)))
- (kill-region b (+ 1 e)) ; +1 because we need remove the CR
+ ;; +1 because we need remove the CR
+ (setq e (+ 1 e))
+ (if (> e (point-max)) (setq e (point-max)))
+ (kill-region b e)
))))
;;;###autoload