I notice that when I press Ctrl-backspace on this form, it deletes the whole form instead of the word like it is supposed to. Looks like it is something calva is doing, because I don't get this in a new plain text buffer. Is this intentional?
m/Axis.horizontal
I expected to end up with m/Axis. after hitting that shortcut, like you do in other editors (Cursive, VSCode plain text, etc).Same thing with Ctrl-Delete, except in the other direction (it deletes to the right of the cursor, instead of to the left.)
Is it possible that you have paredit enabled, and ctrl+delete is bound to Kill Sexp Backward? More info on paredit here: https://calva.io/paredit/
@john.t.richardson.dev I do have paredit on, but I don't think that is it, because this is what I see under keybindings:
If you search for ctrl+delete in keybindings, do you see it also bound to Calva Paredit: Kill Forward to End of List?
@john.t.richardson.dev Oh yea, I think I saw and deleted that one
But that screenshot above is full list of matches for me now
You're right. Even if I remove that entry too, I get the same behavior. And I can see in the debugger that it's invoking killBackwardList
Must be a bug, right?
I'm not sure. I tried rebinding Calva's ctrl+delete to a different keybinding and killBackwardList is no longer invoked. But the behavior is still the same
I was thinking the bug is that calva is changing the definition of a word to be a sexp instead, but not sure.
It might be changing something, but it seems unrelated to paredit. With VSCode keybinding debugging on, I see
So it's using the built-in deleteWordLeft
But you're right, if a word could be changed that would do it.
It might be this, from package.json:
I think you could change that in your settings.json
Looks promising, but for me it acts the same
I haven't tried yet, but a random search shows it would be something like:
"[powershell]": {
"editor.wordSeparators": "`~!@#%^&*()=+[{]}\\|;:'\",.<>/?",
}
But not powershell, of course πwait that worked
wow, nice find!
I don't know that @pez would approve π, seems like a hack
But glad it works!
Appreciate it!
Just for completeness if someone finds this later. This did work for me in settings.json:
"[clojure]": {
"editor.wordSeparators": "x",
}
And now ctrl+delete stops at the x in m/Axis.horizontal> I notice that when I press Ctrl-backspace on this form, it deletes the whole form instead of the word like it is supposed to. Looks like it is something calva is doing, because I donβt get this in a new plain text buffer. Is this intentional?
Yes. Or, it is a consequence of how we have chosen to define words in Calva defaults. But it is only defaults, and itβs up to the user to go with them or change them. Itβs documented here: https://calva.io/customizing/#clojure-defaults
Does Tonsky formatting work in Calva? Seems like no after trying the instructions here: https://calva.io/formatting/#indentation-rules
@doppiaelle1999 thanks, that one does appear to work
The test code looks like this after formatting for me:
(concat [2]
(map #(inc (* % 2))
(filter #(aget sieved %)
(range 1 hn))))I think this was working at some point.
This one works for me with what IIRC are off-the-shelf configs:
{:remove-surrounding-whitespace? true
:remove-trailing-whitespace? true
:remove-consecutive-blank-lines? false
:insert-missing-whitespace? false
:indents {#re ".*" [[:inner 0]]}}
perhaps it's the regex