Hey there! I just released 1.0.154 with natural structural navigation, please give it a try! I'll update the docs soon... Structural nav is used with Alt+Arrows, and it's "natural" in a sense that you press the arrow of the direction you want the cursor to move, and it jumps by value. Hard to explain, but it's sort of similar to navigating the tables and REBL. Very curious to hear your opinions since I haven't seen such struct nav implementations before
I also updated auto-scrolling behavior to use structural information in a way that shows the start of the output instead of always scrolling to the bottom... Should have been 1.1.154 really :D
@vlaaad Thanks. Will update right now and let you know how it goes 🙂
Documented it here: https://vlaaad.github.io/reveal/#structural-navigation
Hmm, I don't have home/end keys on my (mac) keyboard. If I'm inside a vector of hash maps and on the {
of a map, I would expect alt-down to take me to the {
of the next element of the vector, but it takes me a few elements inside it, as if it is navigating a bit too far?
btw have you seen these messages? > I remember you mentioning long time ago that fastest way to navigate for you was using alt arrows that scrolls by N rows or something > I remember it because it felt off since Reveal didn’t have such a thing
@seancorfield ping :) have you tried structural navigation on a different mac? I couldn't reproduce your problem. What jdk do you use btw?
We only have one Mac. I've been using JDK 14 mostly. I'll confirm the JDK and OpenJFX versions when I get to my desk.
Fn+Option+Left
and Fn+Option+Right
worked for me as Alt+Home
/`Alt+End` on mac
do you still experience brokenness of structural navigation?
and Fn+Option+Down
/ Fn+Option+Up
(as well as just Fn+Up
/`Fn+Down`) work for me as a textual, not structural, Page Up
/ Page Down
(there is no structural Page Up/Down)
@vlaaad Yeah, I figured out the home/end further up in this thread. My current JDK is 15+36 and my OpenJFX is 15-ea+6.
I'm on 1.1.159 of Reveal.
I did some brief work over the weekend on my Windows laptop and I'm running Reveal there on WSL via VcXsrv and structural navigation seemed more in line with what you described and what I expected.
I haven't really dug into it at work today yet.
So then I have to go up up left to get back to the {
and then alt-down takes me to the same relative element of the next map (the third key)
Combined with the auto-scroll to display the start of each printed expr, it's definitely an improvement.
hmm, that shouldn't happen... can you share that vector of hashmaps?
Not easily, it's a large blob of data from our system at work.
If it matters, it uses qualified keywords for all the keys?
probably doesn't matter. Can't reproduce it with
[{:a/a 1}
{:b/b 2}
{:c/c 2}]
regarding missing home/end, I'll think what I can do...
Maybe you can bind ctl-alt-left and ctl-alt-right to home/end?
it might interfere with some linux distros that use ctrl+alt+arrows to navigate between virtual desktops... that probably will require os-specific keybindings. I think it's inevitable, but I would prefer to do it later..
it would be great if you could make a repro for "over-nav" — I tried various big nested vectors of maps to no luck
Are you testing on a Mac?
I didn't, but I have access to a Mac. I'll try that tomorrow, it's too late here in Europe. Going to sleep now, I'll get back to you later!
Here's a small example that seems to have strange behavior:
[[1 2 3]
[4 5 6]
[7 8 9]]
With the cursor on the second [
(just before the 1
), alt-right puts the cursor on the 3
. If I do alt-down instead, the cursor ends up on the [
before the 7
-- skipping the second element of the vector. Is that what you would expect?no, Alt-right should go to 1
and alt+down should go to the [
before 4
hmmm
I remember you mentioning long time ago that fastest way to navigate for you was using alt arrows that scrolls by N rows or something
If I'm on the ]
after the 3
and do alt-left, I end up on the outer [
rather than then inner [
which is also a bit of a surprise.
I remember it because it felt off since Reveal didn't have such a thing.
If I'm on that outer [
and do alt-right, I end up on the 2
.
Maybe on mac Alt+arrow emits repeated key events?
If I'm on the 2
and do alt-right, I end up on the 1
(not the 3
).
well, this is super weird
(and alt-right on the 3
takes me to the 1
🙂 )
I just confirmed I really am using 1.0.154, and I can see the output tracks (and highlights) the first element of each new result and scrolls as expected.
But otherwise, the alt-arrow keys are mostly behaving exactly the same on 1.0.137 and 1.0.154
And I just discovered that home is fn-alt-up and end is fn-alt-down -- but that's the same behavior on both 1.0.137 and 1.0.154 so I'm suspecting those are just macOS defaults... and maybe none of your key bindings are actually working on macOS?
Anyways, thank you for all you do on Reveal, and we can chat tomorrow.