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

Word boundaries spanning - by default #1246

Closed
otwieracz opened this issue Jul 31, 2021 · 5 comments
Closed

Word boundaries spanning - by default #1246

otwieracz opened this issue Jul 31, 2021 · 5 comments
Labels
configuration documentation Better documentation needed. editing

Comments

@otwieracz
Copy link

With Calva plugin enabled, word boundaries are not correctly respected with Vim plugin.
I.e. hitting w on (|foo-bar car) should move cursor before -, that is (foo|-bar car).
With Calva enabled, it jumps to whitespace: (foo-bar| car).

See attached video:
https://drive.google.com/file/d/1htBJ8tj2HMko2PDGZCsCs8X5FTrOMYeN/view?usp=sharing

@PEZ
Copy link
Collaborator

PEZ commented Jul 31, 2021

Calva defines Clojure word boundaries. There is probably nothing we can do about this. It's similar with how double-clicking foo in (foo-bar car) will select foo-bar.

@bpringe bpringe added editing documentation Better documentation needed. and removed documentation Better documentation needed. labels Jul 31, 2021
@alpox
Copy link
Contributor

alpox commented Jul 31, 2021

This can for now be fixed by adding the - to the editor.wordSeparators setting. As calva defines the editor.wordSeparators for clojure specifically one has to override that setting for that language as following:

"[clojure]": {
   "editor.wordSeparators": "\t ()\"':,;~@#$%^&{}[]`-",
 }

@PEZ
Copy link
Collaborator

PEZ commented Aug 3, 2021

I've tried this now. Indeed, adding - to word separators changes the behaviour of double-click as well. So this is rather a matter of taste than anything else. We should mention this here: https://calva.io/customizing/

@PEZ PEZ added configuration documentation Better documentation needed. labels Aug 3, 2021
@PEZ PEZ changed the title Word boundaries with vim plugin are not respected Word boundaries spanning - by default Aug 3, 2021
@otwieracz
Copy link
Author

Yes, it's unfortunate and I agree both solutions have their own disadvantages. Best thing that can be done here is to document it.

@PEZ PEZ closed this as completed in c70491b Aug 3, 2021
PEZ added a commit that referenced this issue Aug 3, 2021
@PEZ
Copy link
Collaborator

PEZ commented Aug 3, 2021

Documentation updated. Thanks for highlighting the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration documentation Better documentation needed. editing
Projects
None yet
Development

No branches or pull requests

4 participants