Sb2: UI: medium: typewriter scroll point not remembered

If you’re scrolling around a document and type something in full screen typewriter mode, the document snaps to a point so that the insertion point is now vertically centred, as should be expected.

But if you’ve hidden the scroll bar, the instant you begin scrolling again, the document snaps back to the point before typewriter mode reset the scroll point. This doesn’t happen if the scroll bar is visible.

Will take a look at this.

Okay, I’ve taken a look and it isn’t a Scrivener bug (which isn’t to say that it isn’t a bug :slight_smile: ). If you get rid of typewriter scrolling, you will see that the same thing happens. Get rid of typewriter scrolling and then, in a long document, set the cursor to the middle. Now scroll somewhere else and start typing so that the scroll point jumps to the insertion point. Then use two-finger scroll - if the scroller is hidden, you will see the behaviour you describe. I just tried the same thing in CopyWrite, which also allows you to hide the scroll bar, and got exactly the same problem - so the bug seems to be a Cocoa bug, which is out of my hands, I’m afraid. (You can report bugs with OS X at



One more thing: is it a bug in Apple’s scrolling mechanism that occurs where there is no scroll bar in a text area, or when the scroll bar is invisible? If it’s just the former, why not just make the scroll bar invisible, rather than not having one at all?

Sorry jebni, could you rephrase that, as I don’t understand what you mean. Thanks!

P.S. There is definitely a lot of bugginess related to scroll bars in Cocoa, especially when you are looking at a scaled view. Scroll bars often appear when they are not even needed in a scaled text view, for instance.

I was just thinking that MacJournal has three scroll bar options for full screen: (1) no scroll bar (which also disables two-fingered/scrollwheel scrolling completely, which is kinda silly), (2) hide the scroll bar until you mouse over it, and (3) show the scroll bar all the time.

I found that in MacJournal, Option 2 isn’t prone to the Cocoa scrolling bug we’re talking about. Is this because the bug only appears when there’s no scroll bar specified by the app, whereas with MacJournal’s “hide and show scroll bar” option the scroll bar is still actually there, but just invisible most of the time?

I know you’ve decided against showing the scroll bar on mouseover (though I’d again humbly ask you to consider showing it on mousing over any area to the right of the page area), but to get around this Cocoa scrolling bug, perhaps you could do something similar under the hood – retaining a scroll bar when the user unchecks “show scroll bar” in Prefs, but making it invisible?

This is actually already what happens - the scroll bar is really there, but not visible. It only becomes visible when there is an actual scroller knob to show. The bugs lie with the system, which tell the scroller to gain a knob when unnecessary. This is because when scaling a text view, the whole view has to be scaled, not just the text - including the empty area below. Typewriter scrolling necessarily extends the area below the text view too.

I’m totally confused now! :slight_smile:

Basically, I’m not clear about what triggers this scrolling bug we’ve been discussing – not because I really want to know :wink:, but to see if there’s a way you can hack your way around that bug.

I assume that if this bug only happens when you set the app in Preferences to hide the scroll bar in full screen mode, then MacJournal and Scrivener must implement this kind of “full screen scroll bar concealment” differently – AFAIK, MacJournal can hide the scroll bar and yet avoid this particular Cocoa jumpy-scrolling bug.

Admittedly, I’m talking about MacJournal’s option to keep the scroll bar hidden until you mouse over its invisible hit area, which is admittedly different to its “real” option to completely hide the scroll bar, which disables scrolling altogether for everything but the keyboard. But wouldn’t it be possible to copy the way the MacJournal does this “hide until mouseover” trick, and just remove the bit that makes the scroll bar appear on mouseover? Thus, you have a scroll-bar-free full screen mode that lets you two-finger/mousewheel-scroll to your heart’s content, without this weird jumpy scroll bug. (The MacJournal devs should certainly try it, since it would be clearly better than their keyboard-only scroll mode.)

Of course, MacJournal might implement its full screen mode in a way that renders this impossible in Scrivener. Just curious is all.

Thanks for your patience, Keith! Remember: I think Scrivener is practically the holy grail of full screen editing.

You know what, I think I’m getting confused. I told you wrong. Scrivener does completely hide the scroll bar. It’s only in normal mode where the scroll bar is really there but invisible until there is enough text… Hmm.

Anyway, given that this is a Cocoa bug, I don’t really want to hack my way around it. That said, I do have on my list, though very secretly, the ability to fade in and out the scroll bar when the mouse is moved, like the way WriteRoom does it (which is rather elegant). This is “secret” because I don’t guarantee that I’ll implement it - I’ll just look into it. Although I think I recently found a really easy way to do this… So we’ll see. :slight_smile: