Skip to content

Use syntax instead of hard-coded chars #1959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions evil-common.el
Original file line number Diff line number Diff line change
Expand Up @@ -1539,11 +1539,10 @@ backwards."
"Move forward COUNT words.
Moves point COUNT words forward or (- COUNT) words backward if
COUNT is negative. Point is placed after the end of the word (if
forward) or at the first character of the word (if backward). A
word is a sequence of word characters matching
\[[:word:]] (recognized by `forward-word'), a sequence of
non-whitespace non-word characters '[^[:word:]\\n\\r\\t\\f ]', or
an empty line matching ^$."
forward) or at the first character of the word (if backward). A
word is either determined by `forward-word', or is a sequence of
characters not in the word or whitespace syntax classes, or an
empty line matching ^$."
(evil-forward-nearest
count
#'(lambda (&optional cnt)
Expand All @@ -1553,19 +1552,19 @@ an empty line matching ^$."
(forward-word cnt)
(if (= pnt (point)) cnt 0)))
#'(lambda (&optional cnt)
(evil-forward-chars "^[:word:]\n\r\t\f " cnt))
(evil-forward-syntax "^w->" cnt))
#'forward-evil-empty-line))

(defun forward-evil-WORD (&optional count)
"Move forward COUNT \"WORDS\".
Moves point COUNT WORDS forward or (- COUNT) WORDS backward if
COUNT is negative. Point is placed after the end of the WORD (if
forward) or at the first character of the WORD (if backward). A
WORD is a sequence of non-whitespace characters
'[^\\n\\r\\t\\f ]', or an empty line matching ^$."
WORD is a sequence of characters not in the whitespace syntax
class, or an empty line matching ^$."
(evil-forward-nearest count
#'(lambda (&optional cnt)
(evil-forward-chars "^\n\r\t\f " cnt))
(evil-forward-syntax "^-" cnt))
#'forward-evil-empty-line))

(defun forward-evil-symbol (&optional count)
Expand Down