Skip to content

Commit

Permalink
Renamed isWORDseparator to isseparator.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fiveisky committed Sep 27, 2023
1 parent 4d78c81 commit 2502287
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
18 changes: 9 additions & 9 deletions extensions/vi-mode/options.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -379,25 +379,25 @@
(option-value option))
:test 'equal)))))

(defvar *default-isWORDseparator* (mapcar #'string '(#\Newline #\Space #\Tab)))
(defvar *default-isseparator* (mapcar #'string '(#\Newline #\Space #\Tab)))

(defun compile-isWORDseparator (value)
(compile-rules value "isWORDseparator"))
(defun compile-isseparator (value)
(compile-rules value "isseparator"))

(define-option "isWORDseparator"
((cons *default-isWORDseparator*
(compile-isWORDseparator *default-isWORDseparator*))
(define-option "isseparator"
((cons *default-isseparator*
(compile-isseparator *default-isseparator*))
:type list
:aliases ("isWs")
:aliases ("iss")
:scope :buffer)
(:documentation "Comma-separated string to specify the characters that should be recognized as non broad word characters. (buffer local)
Aliases: isWs")
Aliases: iss")
(:getter (option)
(car (option-raw-value option)))
(:setter (new-value option)
(setf (option-%value option)
(cons new-value
(compile-isWORDseparator new-value))))
(compile-isseparator new-value))))
(:initializer (option)
(let ((syntax-table (lem:mode-syntax-table (lem:buffer-major-mode (lem:current-buffer)))))
(setf (option-value option)
Expand Down
14 changes: 7 additions & 7 deletions extensions/vi-mode/tests/options.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
(ok (equalp (option-value "iskeyword") isk)
"Another buffer's local option is not changed"))))))

(deftest isWORDseparator-option
(ok (typep (get-option "isWORDseparator") 'option)
"Can get isWORDseparator option")
(ok (typep (get-option "isWs") 'option)
"Can get isWORDseparator option by alias")
(deftest isseparator-option
(ok (typep (get-option "isseparator") 'option)
"Can get isseparator option")
(ok (typep (get-option "iss") 'option)
"Can get isseparator option by alias")
(with-fake-interface ()
(with-vi-buffer (#?"abc\n[(]def)\n")
(cmd "E")
(ok (buf= #?"abc\n(def[)]\n")))
(with-vi-buffer (#?"abc\n[(]def)\n")
(execute-set-command "isWs+=(")
(execute-set-command "isWs+=)")
(execute-set-command "iss+=(")
(execute-set-command "iss+=)")
(cmd "WE")
(ok (buf= #?"abc\n(de[f])\n")))))
2 changes: 1 addition & 1 deletion extensions/vi-mode/word.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
(t :non-word))))

(defun non-broad-word-char-p (char)
(funcall (cdr (option-raw-value "isWORDseparator"))
(funcall (cdr (option-raw-value "isseparator"))
char))

(defun broad-word-char-type (char)
Expand Down

0 comments on commit 2502287

Please sign in to comment.