I can write, but no text is displayed

[edit] Oops, I meant to create this in Bug Hunt. Sorry. [/edit]

Something a little annoying is happening as of lately.

At some point during my work day, the current document I’m typing in stops displaying newly typed text. But I can continue to type, I simply can’t see what I’m typing. I have to click on a different document and back on the original one to see what I typed.

Fullscreen view works flawlessly, though.

I found this in the Console:

30/01/11 12:08:16 AM Scrivener[4371]
-[KBLayoutManager _fillGlyphHoleForCharacterRange:startGlyphIndex:desiredNumberOfCharacters:] *** attempted glyph generation while textStorage is editing. It is not valid to cause the layoutManager to do glyph generation while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.)

It’s not a huge problem, more of an inconvenience. I have to restart Scrivener and everything is fine. But my session target counter gets reset, and I like to know how much I’ve typed by the end of the day.

Running Scrivener 2.0.2 on Intel.

Hi,

This is a nasty layout bug somewhere. As soon as that occurs, text won’t display properly until you restart. I’d really like to fix this, so could you please see if you can find a particular trigger? There must be something specific that causes this somewhere in the text. It could be something like one of the following:

• Hyphenation being turned on in the preferences.
• Special characters in the text.
• A bug in page layout (if you are using page layout).

Does it happen in one particular document? If you can find a particular trigger and help me reproduce it, I’d be really grateful.

Thanks!

All the best,
Keith

Sure, I’ll try.

As far as I can tell so far:
No hyphenation turned on.
No special characters in the text.
What is page layout? :open_mouth: I guess I’m not using it, or am I?

I’ll see if I notice something next time it happens.

At a guess, “wrap to page” mode rather than “wrap to editor.” Turn it on/off via View>Page View>Show/Hide Page View or the “wrap” button in the toolbar.

Ah ok. No, wasn’t using it.

That’s good to know, thanks. One thing to try is this (assuming your screen is large enough to do this comfortably):

• Open Console.app from ~/Application/Utilities, as described.
• Place the console window alongside your Scrivener window.
• Make sure the console window is visible all the time you are typing.

This way, when the error occurs, you should see it pop up in the Console window as soon as it happens. (One thing you could try also is just hammering out lots of random letters for a while, too, to see if it occurs then so that you don’t have to keep an eye on the Console while writing properly.)

Once you see the error pop-up on the Console, take note of what exact text you were writing at the time. Restart Scrivener, and then type the same text again to see if you can get the error to occur again.

Thanks!

All the best,
Keith

I think it happened again. Don’t have the time to experiment with this (have to hand in my first draft this week), so I’ll just tell you what I did and dump the console messages.

I wrote roughly 600 words in a document, converted the document to a folder, created a document in the folder, clicked on the folder (in composite view), marked the text I had written, hit cmd-X, boom -> text stayed on screen.

Console (the last error message then continued to pop up a million times):

16/02/11 3:40:06 AM Scrivener[1399] NSMutableRLEArray replaceObjectsInRange:withObject:length:: Out of bounds

16/02/11 3:40:18 AM Scrivener[1399] -[KBLayoutManager _fillGlyphHoleForCharacterRange:startGlyphIndex:desiredNumberOfCharacters:] *** attempted glyph generation while textStorage is editing. It is not valid to cause the layoutManager to do glyph generation while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.)

16/02/11 3:40:18 AM Scrivener[1399] Exception raised during background layout: -[KBLayoutManager _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] *** attempted layout while textStorage is editing. It is not valid to cause the layoutManager to do layout while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.)

16/02/11 3:40:18 AM Scrivener[1399] -[KBLayoutManager _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] *** attempted layout while textStorage is editing. It is not valid to cause the layoutManager to do layout while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.)

16/02/11 3:40:18 AM Scrivener[1399] -[KBLayoutManager _fillGlyphHoleForCharacterRange:startGlyphIndex:desiredNumberOfCharacters:] *** attempted glyph generation while textStorage is editing. It is not valid to cause the layoutManager to do glyph generation while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.)

This has happened to me a few times too (including once when I couldn’t quit Scriv). Same project, but different documents each time.

Not sure of the exact sequence (since I was concentrating on the text, not the software) but it definitely happened today after changing document to a folder.

Note: I’ve saved a copy of the Scrivener console logs in case that helps.

Hi,

Unfortunately in this case the console logs don’t help - or rather, they won’t tell me more information than the console logs already posted have done (unless they say something completely different, that is). The error tells me that the text system is trying to access characters that don’t exist, but unfortunately that could be anywhere in thousands of lines of code. What I really need is a trigger - something that always causes this error to occur.

I’ve been meaning to list this error in this thread:

https://forum.literatureandlatte.com/t/the-crashers-for-copies-or-even-cash-thread/10045/1

So how’s that for a challenge? I will pay $200 to the first user who can give me exact instructions on how to reproduce this, and which actually lead me to being able to reproduce it in the latest version of Scrivener. Be sure you post your reply with the instructions in the thread linked to above (if you send me an e-mail with instructions and a project, be sure to post in the thread above saying you’ve done so - that way no one can argue over who was first :slight_smile: ).

Thanks!

All the best,
Keith

Sorry, I should have replied to this thread a couple of days ago: I think nom has claimed this prize as he provided me steps to reproduce a few days ago, and I think I’ve fixed it. Please download the latest beta:

https://forum.literatureandlatte.com/t/scrivener-2-x-update-betas-download-here/11262/1