Refactor gpolonkai/goto-next-char for a bit more performance
This commit is contained in:
parent
3011905d2b
commit
e66540149d
@ -608,10 +608,8 @@ line first. Then jump to the actual end of the line."
|
|||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun gpolonkai/goto-next-char (chr)
|
(defun gpolonkai/goto-next-char (chr)
|
||||||
(interactive "c")
|
(interactive "c")
|
||||||
(let ((substr (char-to-string chr))
|
(when (search-forward (char-to-string chr) (pos-eol) t)
|
||||||
(end (save-excursion (end-of-line) (point))))
|
(backward-char)))
|
||||||
(when (search-forward substr end t)
|
|
||||||
(backward-char))))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Move to the beginning of the next word
|
*** Move to the beginning of the next word
|
||||||
|
Loading…
Reference in New Issue
Block a user