Vimpulse bug report: vimpulse-end-of-previous-word fails on punctuation
Hello, I've found a bug into `vimpulse-end-of-previous-word', which is bound to "gb". The bug happens when previous word is a symbol, like this into an Emacs Lisp buffer (| is point): (defu|n If I hit "gb", point does not move. I've read implementation of `vimpulse-end-of-previous-word', and my understanding is that here: (unless (vimpulse-beginning-of-Word-p) (viper-backward-Word 1)) ;; Point oves at the beginning of "defun" (viper-backward-Word val) ;; Here point is on the ( (viper-end-of-Word '(1 . ?r)) ;; This makes point move to end of "defun" This bug is still present in Git repository. Tested with "emacs -Q" followed by "(require 'vimpulse)". Software: - GNU Emacs 23.2.1 - Debian GNU/Linux. Thank you for your attention. Elena
On 2010-12-15 00:31, Elena wrote:
I've found a bug into `vimpulse-end-of-previous-word', which is bound to "gb". ... If I hit "gb", point does not move.
Should be fixed in commit bd05f05 -- refresh your repository with "git pull". -- Vegard
Vegard Øye <vegard_oye <at> hotmail.com> writes:
On 2010-12-15 00:31, Elena wrote:
I've found a bug into `vimpulse-end-of-previous-word', which is bound to "gb". ... If I hit "gb", point does not move.
Should be fixed in commit bd05f05 -- refresh your repository with "git pull".
Hi Vegard, fixed. Thanks. I think the function should have been named vimpulse-end-of-previous-*W*ord (and bound to "gE" instead of "gb" if your intention were to mirror Vim). Speaking of Vim, it has a "ge" command too, which moves to end of previous word (not Word). Could we have a such a command in Vimpulse too? I've tried implementing it, based on your code, but my implementation is buggy. Would you please look at it? Here it is (comments show my understanding of how function works): (defun my-vimpulse-beginning-of-word-p () (or (bobp) (save-excursion (cond ((viper-looking-at-alpha) (backward-char) (not (viper-looking-at-alpha))) ((not (viper-looking-at-alphasep)) (backward-char) (viper-looking-at-alphasep)))))) (defun my-vimpulse-end-of-previous-word (arg) "Move point to end of previous word." (interactive "P") (viper-leave-region-active) (let ((val (viper-p-val arg)) (com (viper-getcom arg))) (when com (viper-move-marker-locally 'viper-com-point (point))) ;; We must start at the beginning of current word, ;; otherwise the following backward-word will ;; not work. (unless (my-vimpulse-beginning-of-word-p) (viper-backward-word 1)) ;; Skip line boundaries. (when (bolp) (skip-syntax-backward " >")) ;; Go to beginning of previous word. (viper-backward-word val) ;; If current word is one character long (for instance: ;; punctuation), we are at the end of the word already. (unless (viper-end-of-word-p) (let (viper-com-point) (viper-end-of-word '(1 . ?r)))) (if com (viper-execute-com 'viper-end-of-word val com) (backward-char))))
participants (3)
-
egarrulo -
Elena -
Vegard Øye