You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected behaviour in boon-find-char-* functions #147
First of all, thank you for boon, it's truly a fantastic package, very well thought out!
I've only recently started using boon, so I apologize if I'm missing something. The functions boon-find-char-backward and boon-find-char-forward confused me somewhat. Namely, they won't move if I'm already on the same char.
Now I'm coming from Evil, so maybe this is intended, in which case I apologize. It seems more useful to me to modify the functions slightly, like so:
;;;###autoload
(defun boon-find-char-backward (char)
"Move the cursor backwards, until finding an occurence of the character CHAR."
(interactive "cType the character to find")
(backward-char 1) ; <- here
(search-backward (make-string 1 char))
(forward-char 1))
;;;###autoload
(defun boon-find-char-forward (char)
"Find the given character (as CHAR), forwards."
(interactive "cType the character to find")
(forward-char 1) ; <- here
(search-forward (make-string 1 char))
(backward-char 1))
After all, when I'm already on the same char, chances are I want to find the next occurrence.
boon-find-char is generally not very consistent because of how emacs cursor works. If you useboon-take-region with it then forward would act like dtCHAR in vim and backward would act like dfCHAR. I find avy-goto-word-1 and avy-goto-char a lot more useful. It suffers from the same problem but at least I can set precise position more easily. No ; and , mashing needed.
@1256-bits that is simply Emacs cursor behaviour differing from vim/evil. Boon rolls with Emacs, but someone coming from evil might understandably be confused. I disagree about it being inconsistent though.
Activity
1256-bits commentedon Feb 4, 2025
boon-find-char is generally not very consistent because of how emacs cursor works. If you use
boon-take-regionwith it then forward would act likedtCHARin vim and backward would act likedfCHAR. I findavy-goto-word-1andavy-goto-chara lot more useful. It suffers from the same problem but at least I can set precise position more easily. No;and,mashing needed.goderich commentedon Feb 12, 2025
@1256-bits that is simply Emacs cursor behaviour differing from vim/evil. Boon rolls with Emacs, but someone coming from evil might understandably be confused. I disagree about it being inconsistent though.