URL off by one when moving through posts with keyboard

(Jay Pfaffman) #1

When you scroll through posts with j,k, the post number shown in the URL is off by one. That is, when you have post 7 selected (as confirmed by clicking the link icon), the URL shown is for post 6.

Expected behavior, the selected post will be reflected in browser URL so that you can copy and paste it without using the mouse.

Internal Link Shortcuts
(Rafael dos Santos Silva) #2

It workins fine here until you are on the last 5 posts.

It looks like the url is updated only by scroll position, and on the last posts you aren’t scrolled down enough (if they are small) to update the url accordingly.

Having two different code portions updating the url can be dangerous.

(Jay Pfaffman) #3

Well, it’s more complicated than I thought. It just doesn’t always update. I checked on the thread you linked * it’s right at 14 and doesn’t change when I move to 15 and at 16 it’s off by one. And it happens again at 23, so it’s off by two at 26.

That sounds true.