d$ and c$ should not delete empty lines
In vi/vim when you press c$ or d$ on an empty line, it does not delete the line, but vimpulse.el does. It makes it impossible to record keyboard macros that use c$ or d$ command, since you never know if line will be deleted or not (ie if line has single space, it will not be deleted, otherwise it will). Following patch fixes the problem, and makes it work like vim. diff -r c8fad78272a5 -r 192808962006 elisp/vimpulse.el --- a/elisp/vimpulse.el Mon Jul 04 13:18:15 2011 -0400 +++ b/elisp/vimpulse.el Sun Jul 10 09:45:30 2011 -0400 @@ -2854,7 +2854,12 @@ (end (max from to))) (save-excursion (goto-char end) - (unless (eobp) + (unless (or (eobp) + ;; do not extend the range on empty lines + ;; this prevents c$ or d$ from deleting + ;; the EOL character + (and (= beg end) + (eolp))) (setq end (1+ end))) (vimpulse-make-motion-range beg end 'inclusive))))
On 2011-07-10 15:52 +0200, Max Mikhanosha wrote:
In vi/vim when you press c$ or d$ on an empty line, it does not delete the line, but vimpulse.el does.
Thank you for bringing my attention to this subtle detail; it should be fixed in commit a3a2fc1. I adjusted `viper-goto-eol' instead of changing the behavior of inclusive ranges, since a Visual characterwise selection (which is also based on inclusive ranges) may very well include the newline of a blank line. You should be using the Git version of Vimpulse if you aren't already. Get it with the command below and add the resulting directory to your `load-path', e.g., (add-to-list 'load-path "~/.emacs.d/vimpulse").
From then on, you can use "git pull" to obtain the latest updates.
git clone git://gitorious.org/vimpulse/vimpulse.git -- Vegard
participants (2)
-
Max Mikhanosha -
Vegard Øye