-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Vi non broad word chars #1106
Merged
fukamachi
merged 7 commits into
lem-project:main
from
ilya-fiveisky:vi-non-broad-word-chars
Sep 28, 2023
Merged
Vi non broad word chars #1106
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a1e9cbc
Implemented non-broad-word-char vi mode option.
ilya-fiveisky 1d2139a
Added non-broad-word-char option tests.
ilya-fiveisky b9b22fd
Fixes for COMPILE-RULES implementation and usage.
ilya-fiveisky 10126cc
Merge branch 'lem-project:main' into vi-non-broad-word-chars
ilya-fiveisky 4602a23
Merge branch 'lem-project:main' into vi-non-broad-word-chars
ilya-fiveisky 4d78c81
Renamed non-broad-word-char to isWORDseparator.
ilya-fiveisky 2502287
Renamed isWORDseparator to isseparator.
ilya-fiveisky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,13 @@ | |
(:import-from :lem-fake-interface | ||
:with-fake-interface) | ||
(:shadowing-import-from :lem-vi-mode/tests/utils | ||
:with-current-buffer)) | ||
:with-current-buffer) | ||
(:import-from :named-readtables | ||
:in-readtable)) | ||
(in-package :lem-vi-mode/tests/options) | ||
|
||
(in-readtable :interpol-syntax) | ||
|
||
(deftest get-option | ||
(ok (typep (get-option "number") 'option) | ||
"Can get a global option") | ||
|
@@ -24,3 +28,18 @@ | |
(with-current-buffer (buf) | ||
(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") | ||
(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+=)") | ||
(cmd "WE") | ||
(ok (buf= #?"abc\n(de[f])\n"))))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for writing tests! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like you to take this as a strong opinion, but I'm not sure about this naming.
All Vim options doesn't contains symbols in their name, and all this kind of options starts with
is
.So, maybe
isseparator
orisblank
... something like that looks ideal to me.How do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I suggest
isWORDseparator
because in Vim broad word is called WORD. Otherwise it is not clear separator of what it is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better. That sounds reasonable in some sense, but the upcased name is also strange since all Vim's options have downcased names.
Vim has
isprint
to set custom printable chars, soisseparator
doesn't look weird to me, though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Let it be
isseparator
then.