Fork me on GitHub
#calva
<
2023-02-24
>
Siddharth10:02:26

When I navigate in a list with a Ctrl+Right, is there some way/setting to keep the cursor at front of forms.. many times I want to move to a form and then wish to move just inside the form but then I always need to do Ctrl+Left and then Ctrl+Down , I want to avoid Ctrl+Left here..

pez10:02:38

Not sure I follow... Can you explain it further with some text examples. I like the notation when | is the cursor. Like so:

(defn foo [] (print|ln (pr-str [:foo 42 :bar :baz])))
Pressing ctrl-right moves cursor to:
(defn foo [] (println (pr-str [:foo 42 :bar :baz])|))
Which maybe made me realize what you are suggesting... You want to be able to move to
(defn foo [] (println |(pr-str [:foo 42 :bar :baz])))
? You can do ctrl-down directly, without any ctrl-right, would move you to:
(defn foo [] (println (|pr-str [:foo 42 :bar :baz])))
I might still be misunderstanding something here.... 😃

Siddharth11:02:43

Suppose I am initially at (-> |m :foo :bar (doto prn) :c :d) , now I wish to move inside (doto prn) then currently with ctrl+right, I move to end of (doto prn) and then Ctrl+Left and then Ctrl+Down.

Siddharth11:02:31

If I'm at front of form with Ctrl+Right always, I can just do Ctrl+Down to move inside (doto prn) , without using extra Ctrl+Left which annoys due to shift of flow..

pez12:02:25

And why don't you use ctrl+down directly, from |m?

Siddharth12:02:23

I don't want to go inside any intermediate form..

pez13:02:34

In this case there were no such forms, so ctrl+down will go down in (|doto prn). But let's look at an example with intermediate forms that you could go down in:

(-> |m  {:foo 42} {:bar "baz"} (doto prn) :c :d)
ctrl+right x3:
(-> m  {:foo 42} {:bar "baz"}| (doto prn) :c :d)
ctrl+down:
(-> m  {:foo 42} {:bar "baz"} (|doto prn) :c :d)
Will that work? I'm a bit reluctant to add complexity to the movement commands here, unless it provides benefits that outweigh the complexity.

Siddharth13:02:58

Sorry. I did not chose the proper example. Yes, above will work just that I need to be a bit careful (or think ahead) to not go past the form in which I wish to go down otherwise I need to come back and it slows down the navigation a bit. I would say I would love to use if this is available and it will considerably increase the joy!.

Siddharth13:02:08

If there is something I could help with to implement it..I would be happy to contribute..

pez15:02:13

I think the model of word-navigation to move to the end of the next word is established enough, and in Calva we extend it to instead work on forms. So it makes all sense that it moves to the the other end of the forms. Which would make the behaviour of making it move to the beginning of forms to something optional, either via a separate command, or via a setting. This adds complexity for us (more code and code paths to maintain) and also for the user (more commands or settings to consider). I'm unconvinced that solving the problem you have raised here is important enough for adding this complexity. Totally appreciate both that you bring the problem up, making us aware of it, and that you offer to help with implementing a solution. We can start with that you file an issue on Github about it, and we can check what other users say about it. If you have suggestions for what a solution would look like, you are welcome to add those as comments to the issue. Does this sound like a good start to you?

❤️ 2
Siddharth15:02:58

Yup, definitely, I appreciate the quick and thoughtful consideration given to it, I'm still very productive without it and love to use calva but time to time longed for this option so posted here, I'll file the issue, it will be great start for sure, Thanks a tonne!!! @U0ETXRFEW

❤️ 2
pez23:02:52

❤️ 6
clojure 4