Skip to content
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

Add . and / to cword iskeyword #327

Merged
merged 3 commits into from
Mar 28, 2021
Merged

Conversation

bootleq
Copy link
Contributor

@bootleq bootleq commented Mar 26, 2021

I usually remove . from iskeyword to make word-wise movement easier,
however this can break functions like jump_to_def because incomplete symbol.

How about adding those characters to iskeyword as an safety guard? Avoid affected by user setting.

Ensure our "cword" works even users have those symbols removed from
`iskeyword`.
@liquidz
Copy link
Owner

liquidz commented Mar 26, 2021

@bootleq Thanks for your contribution!

How about adding those characters to iskeyword as an safety guard? Avoid affected by user setting.

When we add only those characters, it will not work with the same reason if other characters are removed from iskeyword.
So it is better for me to have a constant iskeyword for iced#nrepl#var#cword as follows.
How about you?

" c.f. https://vim-jp.org/vimdoc-en/options.html#'iskeyword'
"      https://github.com/vim/vim/blob/v8.2.2660/runtime/ftplugin/clojure.vim#L20
"      https://github.com/liquidz/vim-iced/pull/142
let &isk='@,48-57,_,192-255,?,-,*,!,+,/,=,<,>,.,:,$,#,%,&,39'

Follow PR suggestion, completely avoid affecting by user setting.

The value is taken from Vim 8 default + default clojure ftplugin + #%&,
see PR discussion for more info.
@bootleq
Copy link
Contributor Author

bootleq commented Mar 27, 2021

@liquidz thanks, I've added a commit to use constant iskeyword.

I also see Vim has small different default value for iskeyword on Win32, but I think it is irrelevant to our case, so just use the value you mentioned.

Copy link
Owner

@liquidz liquidz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bootleq Thanks!

I also see Vim has small different default value for iskeyword on Win32, but I think it is irrelevant to our case, so just use the value you mentioned.

👍

autoload/iced/nrepl/var.vim Outdated Show resolved Hide resolved
This would make the code more consistent, clearer to see the option has
been "let" in a 1) store 2) overwrite 3) restore 3-steps fashion.
Copy link
Owner

@liquidz liquidz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bootleq Thanks!

@liquidz liquidz merged commit 71b54d5 into liquidz:main Mar 28, 2021
@bootleq bootleq deleted the cword-iskeyword branch March 29, 2021 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants