[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-nerd-commenter e1de1d759b 137/235: clean code
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-nerd-commenter e1de1d759b 137/235: clean code |
Date: |
Thu, 6 Jan 2022 02:59:42 -0500 (EST) |
branch: elpa/evil-nerd-commenter
commit e1de1d759bcbd1026aeff8e402a2ef7edf546c0d
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
clean code
---
evil-nerd-commenter-operator.el | 23 ++++++++++++-----------
evil-nerd-commenter.el | 3 +--
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/evil-nerd-commenter-operator.el b/evil-nerd-commenter-operator.el
index f107036d64..8052995f6f 100644
--- a/evil-nerd-commenter-operator.el
+++ b/evil-nerd-commenter-operator.el
@@ -40,10 +40,11 @@
(interactive "<R>")
(cond
((eq type 'block)
- (let ((newpos (evilnc--extend-to-whole-comment beg end) ))
- (evil-apply-on-block #'evilnc--comment-or-uncomment-region (nth 0
newpos) (nth 1 newpos) nil)
- )
- )
+ (let* ((newpos (evilnc--extend-to-whole-comment beg end) ))
+ (evil-apply-on-block #'evilnc--comment-or-uncomment-region
+ (nth 0 newpos)
+ (nth 1 newpos)
+ nil)))
((and (eq type 'line)
(= end (point-max))
(or (= beg end)
@@ -51,18 +52,18 @@
(/= beg (point-min))
(= (char-before beg) ?\n))
(evilnc--comment-or-uncomment-region (1- beg) end))
+
((eq type 'line)
(evilnc--comment-or-uncomment-region beg (1- end)))
+
(t
- (let ((newpos (evilnc--extend-to-whole-comment beg end) ))
- (evilnc--comment-or-uncomment-region (nth 0 newpos) (nth 1 newpos))
- )
- ))
+ (let* ((newpos (evilnc--extend-to-whole-comment beg end) ))
+ (evilnc--comment-or-uncomment-region (nth 0 newpos) (nth 1 newpos)))))
+
;; place cursor on beginning of line
- (when (and (evil-called-interactively-p)
- (eq type 'line))
+ (if (and (evil-called-interactively-p)
+ (eq type 'line))
(evil-first-non-blank)))
(provide 'evil-nerd-commenter-operator)
-
;;; evil-nerd-commenter-operator.el ends here
diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index 041a80dae2..6e56c406bf 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -75,8 +75,7 @@
;; "cp" 'evilnc-comment-or-uncomment-paragraphs
;; "cr" 'comment-or-uncomment-region
;; "cv" 'evilnc-toggle-invert-comment-line-by-line
-;; "\\" 'evilnc-comment-operator
-;; )
+;; "\\" 'evilnc-comment-operator)
;;
;; For certain major modes, you need manual setup to override its original
;; keybindings,
- [nongnu] elpa/evil-nerd-commenter ccb31ba534 061/235: finalize doc v1.2.7, (continued)
- [nongnu] elpa/evil-nerd-commenter ccb31ba534 061/235: finalize doc v1.2.7, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 1848bc36a1 077/235: comment to the line is optimized v1.4.0, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 487e1cdf2b 098/235: fixed: upgrade from melpa may fail v1.5.6, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 7c75a0e782 050/235: fixed: initialize error when set up hotkeys, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter b48da5411b 111/235: README updated, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 789a180160 100/235: FIXED: revert work on with-eval-after-load v1.5.8, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 7a1647cf6d 114/235: donot use comma as default hotkey, v 1.5.14, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 770981cffd 130/235: can comment/uncomment mixed code in web-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 8e126cda3d 133/235: workaround haml-mode comment issue, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter a0c21304e6 136/235: support react jsx, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter e1de1d759b 137/235: clean code,
ELPA Syncer <=
- [nongnu] elpa/evil-nerd-commenter 2c62dfcb80 139/235: updated documentation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 11998038f3 143/235: default key bindings can define key bindings in non-evil mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 7c274dbb7e 147/235: remove extra spaces at end of comment object, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 8b5830a003 145/235: remove obsolete macro, Emacs v23.2 is not my concern, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 31db96711e 162/235: make check-doc happy, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 2d31dfba53 156/235: Merge pull request #77 from madand/do-not-compile-operator-file, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 34d411715e 169/235: fixed issue when stripping trailing comment delimiter characters, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 904d9ee2ed 179/235: comment operator should be compatible with evil-matchit, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 341f78551b 182/235: Fix regression for non-visual modes., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 36304a689b 184/235: tested in Emacs 24.4, ELPA Syncer, 2022/01/06