emacs-elpa-diffs
[Top][All Lists]
Advanced

[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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]