calva

pez 2025-08-30T20:42:58.435649Z

Dear Calva friends: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.525 • Bump deps.clj.jar to v1.12.2.1565 • Fix: https://github.com/BetterThanTomorrow/calva/issues/2912 Thanks, @john.t.richardson.dev for reporting. Please let me know if this version doesn’t fix it. There is a glitch that I know of: When Calva starts with the cursor in a comment, the extension context isn’t updated about this, so Calva will behave as before. But just moving the cursor a character this or that way will make it start working. This can probably be fixed, but I figured it is a rare case that you start like that and immediately want to delete a word backwards.

🙌 2
JR 2025-09-07T16:34:14.244439Z

I did this, and it does seem to work. I raised a PR for it. I'd be curious if it would be useful for Linux or Mac too

🙏 1
JR 2025-09-01T22:19:23.619759Z

Now comments and plain text behave the same on my system. Thanks! I agree that, while the startup thing is a bug, it's very, very minor. I noticed another minor bug, it has to do with how a comment is defined. If I'm on a blank line after a comment and hit ctrl+backspace the Calva command killListBackward is executed. This seems inconsequential except when I'm deleting a comment from the end and generate a blank line due to that. If I have

(def m {:a :b
        ;; I want to remove only the second comment
        ;; line|
        }) 
(cursor after "line") and I hit ctrl+backspace twice, I'm left with
(def m {:a :b
        ;; I want to remove only the second comment
        |
        })
and then I hit ctrl+backspace once more, I get
(def m {|
        })

JR 2025-09-01T22:22:14.992279Z

It's understandable in code why this happens (the parser thinks that the comment ended at the end of the remaining comment line). But in user experience it feels like bindings that operate on text to the left of the cursor would be in the context of a comment

pez 2025-09-02T05:52:07.843349Z

It’s a consequence of the change, as you already have figured out. I guess it could be argued that the calva:cursorInComment flag should be on, at that empty line after the comment, but that is also a bit weird. We do have a cursorAfterComment flag, which currently means it is at the end of the the same line as the comment. I think it needs to stay meaning that, but we could add more context. E.g. cursorInWhiteSpaceAfterComment. Then we can decide how to default bind ctrl+backspace, and at the very least users will have the tools to rebind for the type of behaviour you are driving at there. • The code where we figure these contexts out is here: https://github.com/BetterThanTomorrow/calva/blob/36db945577f732cbba248c2c110e62218d2ff719/src/cursor-doc/cursor-context.ts#L59-L94 • Tests: https://github.com/BetterThanTomorrow/calva/blob/36db945577f732cbba248c2c110e62218d2ff719/src/extension-test/unit/cursor-doc/cursor-context-test.ts If you wanna take a look, be my guest. If you decide to try to do anything about it, please issue first and we can discuss, I am not entirely sure we should add this. (But right now I don’t quite see the harm, as long as we have comprehensive tests.)