This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-08
Channels
- # announcements (50)
- # asami (19)
- # babashka (28)
- # beginners (68)
- # calva (34)
- # cider (11)
- # cljdoc (24)
- # clojure (148)
- # clojure-australia (1)
- # clojure-brasil (6)
- # clojure-europe (48)
- # clojure-france (13)
- # clojure-germany (4)
- # clojure-italy (6)
- # clojure-nl (19)
- # clojure-uk (22)
- # clojurescript (36)
- # conjure (3)
- # cursive (10)
- # data-science (1)
- # datascript (3)
- # datomic (12)
- # etaoin (3)
- # events (3)
- # fulcro (33)
- # graalvm (7)
- # honeysql (4)
- # jobs (4)
- # jobs-discuss (11)
- # kaocha (1)
- # keechma (4)
- # luminus (1)
- # malli (10)
- # membrane (8)
- # off-topic (34)
- # pathom (35)
- # pedestal (1)
- # re-frame (15)
- # releases (1)
- # remote-jobs (1)
- # reveal (41)
- # shadow-cljs (42)
- # startup-in-a-month (2)
- # vim (11)
@cb.lists, about wordwise movement in comments and strings. You have that in strings already, right? In comments it is trickier, because most often I want to skip past comments when moving by sexpressions. Maybe we could do something about it when actually inside a comment…
Strings - not exactly, as punctuation doesn't seem to be treated as word boundaries as it is in text files. An example came up for me today editing Compojure routes - with all the /
and :
'wordwise' movement jumps over the whole thing.
Comments - yes I do mean strictly within the comment. It could be even tricker if you had something like an ignore form within a comment. Probably unfair to expect Calva to deal with that ...
My typing self slips into a different mode when editing anything that feels more like text than a structured syntax tree, and I automatically edit as if I'm in a standard text field in a browser. I'm quite willing to believe I'm unusual in that respect!
I think we could add “when clause contexts” for if the cursor is in a string or a comment. Then people can use that to modify their keybindings. (So, then in the keybinding for forwardSexpr you could say !calva:inString
to let the default keybindings kick in.
I know in general (& for good reasons) you're resistant to too many settings being added , and have no idea how many users feel like me about this. But if it's something you want to go ahead with, I'd be happy to scratch my own itch and put in an issue & PR (if I can figure out how to do it).
If we do this by adding contexts for cursor in string and in comment it wouldn’t add settings to Calva. It would be an API we need to keep adhering to, but it would be almost zero cost and the leverage for users is quite big. I would merge the PR without hesitation. I’m not sure where we would be managing the contexts, but I’d be happy to asses it together with you,. There are a some more cursor/structure contexts we can consider managing so it would be well invested time just to figure out the basic mechanism.
OK how about I add a github issue when I get a moment, and we discuss it further there.
OK https://github.com/BetterThanTomorrow/calva/issues/1023. I'm fairly clueless about how to proceed, but I'll make a bit of time late in the week to investigate.
@U0ETXRFEW & @U9A1RLFNV - I've added a PR for this. Happy to edit/rewrite/whatever if it steps on any toes. I've tested somewhat though I don't very easily stray from the happy path.
One thing I forgot to do was look at your test suite. If you typically keep it up with changes I'll need to add something there.
Super. Taking a look as well. Yes, this should be covered with some tests. I found a test pattern the other day that might come in handy. Will show you.
Left a comment on the PR now. Rather long, because these contexts really interests me. I hope it makes sense. 😃
Terrific, thanks @U0ETXRFEW - I shall read with interest (when I'm less cognitively challenged than I am this evening).
Phew, now I see that your map must be fake, because there is only two hours time difference between Kingston and Rural North.
Can this be reopened? https://github.com/BetterThanTomorrow/calva/issues/380
Would you mind providing before/after examples on that linked issue of what Calva's killListForward does and what you want this potentially other command to do so we can get a better idea? I do better with examples
@U0ETXRFEW Your example 4 is already supported by both kill sexp and kill list. Should I leave it out? Or is it something I don't follow?