[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-nerd-commenter 563cdc154b 222/235: fix typo and add u
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-nerd-commenter 563cdc154b 222/235: fix typo and add unit test for web-mode |
Date: |
Thu, 6 Jan 2022 02:59:50 -0500 (EST) |
branch: elpa/evil-nerd-commenter
commit 563cdc154b1f29d181b883563dd37be7eafafdee
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
fix typo and add unit test for web-mode
---
Makefile | 17 +++++++++++------
README.org | 2 +-
evil-nerd-commenter-operator.el | 4 ++--
evil-nerd-commenter-tests.el | 22 ++++++++++++++++++++--
evil-nerd-commenter.el | 4 ++--
5 files changed, 36 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
index d4acfa32a4..411f57e308 100644
--- a/Makefile
+++ b/Makefile
@@ -2,14 +2,19 @@ SHELL = /bin/sh
EMACS ?= emacs
PROFILER =
-.PHONY: test
+.PHONY: test deps
# Delete byte-compiled files etc.
clean:
- rm -f *~
- rm -f \#*\#
- rm -f *.elc
+ @rm -f *~
+ @rm -f \#*\#
+ @rm -rf deps/
+ @rm -f *.elc
+
+deps:
+ @mkdir -p deps;
+ @if [ ! -f deps/web-mode.el ]; then curl -L
https://raw.githubusercontent.com/fxbois/web-mode/master/web-mode.el >
deps/web-mode.el; fi;
# Run tests.
-test: clean
- $(EMACS) -batch -Q -l evil-nerd-commenter-sdk.el -l
evil-nerd-commenter.el -l evil-nerd-commenter-tests.el
+test: deps
+ $(EMACS) -batch -Q -L deps/ -l deps/web-mode.el -l
evil-nerd-commenter-sdk.el -l evil-nerd-commenter.el -l
evil-nerd-commenter-tests.el
diff --git a/README.org b/README.org
index 2b5e867978..55f166b2d4 100644
--- a/README.org
+++ b/README.org
@@ -5,7 +5,7 @@
This program can be used *WITHOUT*
[[https://www.emacswiki.org/emacs/Evil][evil-mode]]!
-A [[http://www.vim.org/scripts/script.php?script_id=1218][Nerd Commenter]]
emulation, help you comment code efficiently. For example, you can press key
=,,99j= or =99,ci= to comment out 99 lines.
+A [[http://www.vim.org/scripts/script.php?script_id=1218][Nerd Commenter]]
emulation, help you comment code efficiently. For example, you can press
=99,ci= to comment out 99 lines.
I recommend using it with Evil though Evil is optional.
diff --git a/evil-nerd-commenter-operator.el b/evil-nerd-commenter-operator.el
index c16d318d11..df5a0a71a4 100644
--- a/evil-nerd-commenter-operator.el
+++ b/evil-nerd-commenter-operator.el
@@ -59,7 +59,7 @@
"Value of`temporary-goal-column' specifying right edge of rectangle yank.")
(defadvice evil-visual-highlight-block (around
evil-visual-highlight-block-hack activate)
- "Show overlay over innert comment text object."
+ "Show overlay over inner comment text object."
ad-do-it
(when (eq this-command 'evilnc-inner-comment)
(dolist (overlay evil-visual-block-overlays)
@@ -190,7 +190,7 @@ Or expand the region to contain whole lines if it's not
comment and certain cond
(t
(goto-char end)
(evil-paste-before 1)
- ;; actual comment operatio should happen at last
+ ;; actual comment operation should happen at last
;; or else begin end will be screwed up
(comment-region begin end)))))
diff --git a/evil-nerd-commenter-tests.el b/evil-nerd-commenter-tests.el
index 61d260d9dc..644e19a1a3 100644
--- a/evil-nerd-commenter-tests.el
+++ b/evil-nerd-commenter-tests.el
@@ -207,7 +207,7 @@
"* heading\n"
"subtext\n")
- ;; move foucs to the middle of source block
+ ;; move focus to the middle of source block
(goto-char (point-min))
(search-forward "hello world")
;; extract src block info
@@ -224,7 +224,7 @@
"console.log('hello world');")
(goto-char (point-min))
- ;; move foucs to the middle the line
+ ;; move focus to the middle the line
(search-forward "hello world")
(should (evilnc-sdk-inside-one-line-p (point) (1- (line-end-position))))
(should (not (evilnc-sdk-inside-one-line-p (point) (1- (point-max)))))
@@ -239,4 +239,22 @@
(should (eq (car range) (save-excursion (goto-char b)
(line-beginning-position))))
(should (eq (cdr range) (save-excursion (goto-char e)
(line-end-position))))))))
+(ert-deftest evilnc-test-latest-web-mode ()
+ (with-temp-buffer
+ (let* (lines
+ (buffer-file-name "hello.css"))
+ (insert ".App {\n"
+ " text-align: center;\n"
+ "}\n")
+ (web-mode)
+ (goto-char (point-min))
+ ;; comment first line
+ (evilnc-comment-or-uncomment-lines 1)
+ (setq lines (evilnc-get-lines (point-min) (line-end-position)))
+ (should (string= (car lines) "/* .App { */"))
+
+ ;; TODO, test uncomment when web-mode has fixed its bug
+ ;; @see https://github.com/redguardtoo/evil-nerd-commenter/issues/115
+ )))
+
(ert-run-tests-batch-and-exit)
diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index 37eeafe202..d3e19fad32 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -160,7 +160,7 @@ Please note it has NOT effect on evil text object!")
("js-mode" "{/* " " */}")
(("web-mode" "html-mode") "<!-- " " -->"))
"List of html tag comment rules.
-The 1st item of each rule is the major mode(s) to match curernt `major-mode'.
+The 1st item of each rule is the major mode(s) to match current `major-mode'.
Current `major-mode' could equal or derive from the listed major mode(s).
The 2nd and 3rd item is the comment start and comment end.")
@@ -595,7 +595,7 @@ to comment to the line 6453"
;;;###autoload
(defun evilnc-toggle-comment-empty-lines ()
- "Toggle the flag which decide wether empty line will be commented."
+ "Toggle the flag which decide if empty line will be commented."
(interactive)
(if comment-empty-lines
(setq comment-empty-lines nil)
- [nongnu] elpa/evil-nerd-commenter 4a72fbd022 207/235: README, (continued)
- [nongnu] elpa/evil-nerd-commenter 4a72fbd022 207/235: README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 76f07963c0 213/235: Update outdated link to emacswiki, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 747e346f11 212/235: Merge pull request #109 from hlissner/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 1bd2de5201 214/235: Merge pull request #111 from duchainer/patch-outdated-link-emacswiki, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 87734b9c7f 218/235: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 6ed6f9ea82 215/235: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter b670f69b64 221/235: add emacs27 to ci, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 2401d871ad 217/235: use GPL version 3, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 8809dccfdb 223/235: user can customize comment style, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 9e7e969719 226/235: try stay put when comment in evil visual line state, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 563cdc154b 222/235: fix typo and add unit test for web-mode,
ELPA Syncer <=
- [nongnu] elpa/evil-nerd-commenter 5535be5421 227/235: (line . column), ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter c0f49e4e87 228/235: fixed minor issue, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 118bebd02a 229/235: use github workflows instead of travis ci, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter c48a95c3ff 234/235: feat: support .tsx files, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter ba535606b4 003/235: add a use case, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 188a475cfc 013/235: Merge branch 'master' of github.com:redguardtoo/evil-nerd-commenter, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 64ee33dac4 022/235: insert live demo link into README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 1cec61caac 038/235: Removed redundant double information, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 1f32941bce 047/235: v1.2.0, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 3ab19bfa4e 052/235: updated README, ELPA Syncer, 2022/01/06