From 4d78c81fd4a5263aa022d56eddfe40710e658bc1 Mon Sep 17 00:00:00 2001 From: Ilia Kruglov Date: Tue, 26 Sep 2023 21:17:06 -0300 Subject: [PATCH] Renamed non-broad-word-char to isWORDseparator. --- extensions/vi-mode/options.lisp | 18 +++++++++--------- extensions/vi-mode/tests/options.lisp | 14 +++++++------- extensions/vi-mode/word.lisp | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/extensions/vi-mode/options.lisp b/extensions/vi-mode/options.lisp index 00c018815..0d855c438 100644 --- a/extensions/vi-mode/options.lisp +++ b/extensions/vi-mode/options.lisp @@ -379,25 +379,25 @@ (option-value option)) :test 'equal))))) -(defvar *default-non-broad-word-char* (mapcar #'string '(#\Newline #\Space #\Tab))) +(defvar *default-isWORDseparator* (mapcar #'string '(#\Newline #\Space #\Tab))) -(defun compile-non-broad-word-char (value) - (compile-rules value "non-broad-word-char")) +(defun compile-isWORDseparator (value) + (compile-rules value "isWORDseparator")) -(define-option "non-broad-word-char" - ((cons *default-non-broad-word-char* - (compile-non-broad-word-char *default-non-broad-word-char*)) +(define-option "isWORDseparator" + ((cons *default-isWORDseparator* + (compile-isWORDseparator *default-isWORDseparator*)) :type list - :aliases ("nbwc") + :aliases ("isWs") :scope :buffer) (:documentation "Comma-separated string to specify the characters that should be recognized as non broad word characters. (buffer local) - Aliases: nbwc") + Aliases: isWs") (:getter (option) (car (option-raw-value option))) (:setter (new-value option) (setf (option-%value option) (cons new-value - (compile-non-broad-word-char new-value)))) + (compile-isWORDseparator new-value)))) (:initializer (option) (let ((syntax-table (lem:mode-syntax-table (lem:buffer-major-mode (lem:current-buffer))))) (setf (option-value option) diff --git a/extensions/vi-mode/tests/options.lisp b/extensions/vi-mode/tests/options.lisp index 9683a80e8..ebbc60ade 100644 --- a/extensions/vi-mode/tests/options.lisp +++ b/extensions/vi-mode/tests/options.lisp @@ -29,17 +29,17 @@ (ok (equalp (option-value "iskeyword") isk) "Another buffer's local option is not changed")))))) -(deftest non-broad-word-char-option - (ok (typep (get-option "non-broad-word-char") 'option) - "Can get non-broad-word-char option") - (ok (typep (get-option "nbwc") 'option) - "Can get non-broad-word-char option by alias") +(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") (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 "nbwc+=(") - (execute-set-command "nbwc+=)") + (execute-set-command "isWs+=(") + (execute-set-command "isWs+=)") (cmd "WE") (ok (buf= #?"abc\n(de[f])\n"))))) \ No newline at end of file diff --git a/extensions/vi-mode/word.lisp b/extensions/vi-mode/word.lisp index f84391aff..5c69450ab 100644 --- a/extensions/vi-mode/word.lisp +++ b/extensions/vi-mode/word.lisp @@ -31,7 +31,7 @@ (t :non-word)))) (defun non-broad-word-char-p (char) - (funcall (cdr (option-raw-value "non-broad-word-char")) + (funcall (cdr (option-raw-value "isWORDseparator")) char)) (defun broad-word-char-type (char)