evil-commentary
evil-commentary copied to clipboard
doesn't work well with gj/gk
Let's say I have the following emacs-lisp code and the cursor rests at the letter t
on the :ensure t
line.
(use-package evil-commentary
:ensure t
:config
(evil-commentary-mode +1))
If I do gcj
, I'll get correct result. However, if I do gcgj
, I'll get this:
(use-package evil-commentary
:ensure ;; t
;; :config
(evil-commentary-mode +1))
Note the ;;
is in front of the letter t, instead for the entire line. This is not how vim behaves with the tpope/vim-commentary plugin.
This issue happens when (setq evil-respect-visual-line-mode t)
as j/k
are mapped to gj/gk
respectively.
Same issue here. An additional issue after using (setq evil-respect-visual-line-mode t)
is that the number of commented lines changes. For example, if we use gc2j
:
- before setting the variable: 3 lines of text including the current line get commented
- after setting the variable: 2 lines of text including the current line get commented
Thanks for the report, this issues has been raised for several times so I'll have a look.