Random scrolling in locked scrivenings

I’ve noticed a strange and intermittent behavior when moving between documents in the binder. If I’m viewing a collection of documents in scrivenings mode and with a locked editor, there are times when using the arrow keys to navigate the binder will cause the editor to scroll to random places. The correct behavior seems to be for the editor to scroll to the top of the newly selected document. And this happens much of the time (and all the time when selecting a document with the mouse). But then there are times when it starts to get all funky and will just jump to what appears to be a random spot of a random document (meaning that it’s not even jumping to the top of a different document), instead of the one that is selected in the binder.

To reproduce it using the attached project:

  • Unzip and open the project (it should already have scrivenings selected and the editor locked - but in case that doesn’t come through on other computers, view the draft in scrivenings and lock the editor)
  • Using the keyboard (ctrl-tab), move to the binder (If the binder is already selected, that shouldn’t impact things - it’s just opening to the editor on my computer)
  • Using the arrow keys, move between documents - there are 7 there, each with 4500 words of the most scintillating latin poetry you can imagine.
  • If the documents are scrolling correctly (i.e. the behavior isn’t happening), switch back and forth between the binder and the editor a few times with the keyboard shortcut, and also try scrolling through the editor. I’ve found that the above steps reproduce it pretty consistently, but sometimes it takes a bit of (seemingly) random behavior to get going.

I’ve tried to test things like text scale, word count, and how quickly I moved between documents, but didn’t see a consistent pattern. Fewer words and a slower speed did maybe make some difference, but the problem didn’t entirely disappear.

I’m using a 15’ 2009 MacBook pro and have had this behavior in 10.6.8 (my original operating system version) as well as 10.9 (my current one). And I’m currently on Scrivener 2.5, but this has been a behavior that I believe was around in previous versions.

I find this more of a small annoyance than a huge problem, but I hadn’t seen it mentioned here before (point me in the right direction if it was) so I thought I’d share.

Thanks for any help you can provide. And let me know if you have any questions.
Scrolling problems.zip (119 KB)

Many thanks for the thorough bug report and the sample project, which allowed me to reproduce the problem straight away. There is no set way to scroll to a the top of a range of text in Cocoa’s text system, so I have my own method for it, but because it might not always be 100% reliable, it falls back on a “just scroll this range to visible” standard method. I think it was that fall-back that was causing the problem. I’ve moved the fall-back, and everything seems to be working fine in the sample project you sent now, so fingers crossed that this is fixed for the next update.

Thanks again and all the best,
Keith

Glad it worked (or rather, didn’t work!) for you. And thanks for the quick reply. Got my fingers crossed!

David