lightspeed.nvim
lightspeed.nvim copied to clipboard
Cannot jump to the desired position if multiple windows contain the same content
For example, I totally opened three windows and the contents of each one are the same.

My cursor is located at line 126 in the leftmost window. I want to jump to itemIndex++
, line 132, in the middle window. So I press gs
followed by it

You can see that all these three windows have the same beacons. Then I press H
. My cursor jumps to line 132 in the rightmost window, instead of the middle one.

Next for the further test, I move the contents in the rightmost window upward a little bit. Now I press gs
followed by `it, and they still have the same beacons and I still cannot jump to the middle window.

Thank you so much.
Hello @ggandor Any workaround for this? Thanks a lot.
This is very tricky, because extmarks (i.e., labels) can only be set for a buffer, and not for a window. So if you open multiple windows with the same content, then you will jump kinda "randomly" to one of them (depends on the order in winlayout
). That said, I don't see why this is such a huge problem - why would you want to open more than two windows with the exact same content in the first place, and jump back and forth between them?
I see. Thanks for the explanation.
That said, I don't see why this is such a huge problem - why would you want to open more than two windows with the exact same content in the first place, and jump back and forth between them?
For example, sometimes we may open three windows with the same file, one window for editing, and the other two for reference. Look at my last screenshot above please. I use the left window for editing, the middle window and the right window to refer different sections. However, as long as the middle window and the right window have same lines even if they are in a different position, we cannot jump to the window we want.
Thank you.
Yeah, I see. If there's even some overlap between two or more windows, it can prevent deterministic cross-window jumping. I don't see how this could be solved... I'll think about it though.