Closed VimCommando closed 5 years ago
Can you give me an example to better understand?
Absolutely. Lets start with a standard 25x80 shell just for consistency, and open a long .json file (I've attached the one I created for testing.)
Now use /
to search for zulu
. The zulu
element will highlight and expand.
Next I want to expand the colors
element we just exposed from searching zulu
. Because Zulu
is highlighted and expanded, I expect the cursor to be there. So I press j
and l
to move down one line and expand colors
.
But the cursor was not there, it instead expands the quebec
element at the top of the screen. If you repeat this for an element near the top of the screen, like searching for echo
the result is much less noticeable because the search result ends up as the second line.
So if you are exploring an unfamiliar JSON structure, this slows you down.
And a couple references from other Linux tools.
Done! I've implemented it. See https://github.com/antonmedv/fx/releases/tag/14.1.0
That is awesome 🎉
Thank you!
Right now if you search for a term, all the hits will highlight, and the screen scrolls to put the first hit at the top of the screen. When there is not enough JSON left, the cursor does not move own from the top of the screen to the highlighted term.
This means if you are searching for a term, and want to expand the JSON at the term hit, you have to manually scroll the cursor down do the hit first. When using keyboard navigation, this defeats the purpose of searching to save time.