Fork me on GitHub
#calva
<
2021-02-08
>
pez09:02:04

@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…

Cris B09:02:12

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!

pez10:02:15

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.

Cris B10:02:45

That sounds like a reasonable approach.

Cris B20:02:25

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).

pez21:02:06

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.

Cris B21:02:03

OK how about I add a github issue when I get a moment, and we discuss it further there.

pez21:02:48

Works for me!

Cris B04:02:37

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.

Cris B00:02:40

@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.

Cris B00:02:04

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.

bringe00:02:56

Awesome! I'm looking at it now

pez07:02:56

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.

pez08:02:25

Left a comment on the PR now. Rather long, because these contexts really interests me. I hope it makes sense. 😃

Cris B08:02:43

Terrific, thanks @U0ETXRFEW - I shall read with interest (when I'm less cognitively challenged than I am this evening).

pez09:02:08

Evening, huh? Where in the world are you? 8PM… Jamaica?

Cris B09:02:49

Australia. Rural North NSW. A tad quieter than Jamaica ...

pez09:02:36

Haha. Of course. But you have to cope with walking upside-down. 😀

pez11:02:36

Phew, now I see that your map must be fake, because there is only two hours time difference between Kingston and Rural North.

clyfe18:02:12

paredit-kill != killListForward

pez18:02:20

What are you missing?

clyfe19:02:12

kill all forms that start after the cursor

clyfe19:02:53

* that start on the current line after the cursor

clyfe19:02:40

In maps/lets kills in pairs in they're on the same line

clyfe19:02:39

Also - kills comments

clyfe19:02:01

And is generally more useful, and it's what I want for my Alt+d

bringe22:02:32

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 simple_smile

clyfe16:02:27

@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?