I can write, but no text is displayed

mi
mitohund
Posts: 70
Joined: Fri Nov 19, 2010 7:44 am
Platform: Mac
Location: Berlin, Germany
Contact:

Sat Jan 29, 2011 2:33 pm Post

[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.

User avatar
KB
Site Admin
Posts: 20500
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Sat Jan 29, 2011 3:58 pm Post

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
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

mi
mitohund
Posts: 70
Joined: Fri Nov 19, 2010 7:44 am
Platform: Mac
Location: Berlin, Germany
Contact:

Sun Jan 30, 2011 1:17 am Post

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? :shock: I guess I'm not using it, or am I?

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

User avatar
MimeticMouton
Posts: 8679
Joined: Wed May 05, 2010 5:39 am
Platform: Mac + Windows
Location: city of rain
Contact:

Sun Jan 30, 2011 1:40 am Post

What is page layout? :shock: I guess I'm not using it, or am I?


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.
Jennifer Hughes
(MM for short)

mi
mitohund
Posts: 70
Joined: Fri Nov 19, 2010 7:44 am
Platform: Mac
Location: Berlin, Germany
Contact:

Sun Jan 30, 2011 3:59 am Post

Ah ok. No, wasn't using it.

User avatar
KB
Site Admin
Posts: 20500
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Sun Jan 30, 2011 10:15 am Post

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
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

mi
mitohund
Posts: 70
Joined: Fri Nov 19, 2010 7:44 am
Platform: Mac
Location: Berlin, Germany
Contact:

Tue Feb 15, 2011 5:47 pm Post

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.)

User avatar
nom
Posts: 1864
Joined: Sun Aug 31, 2008 12:02 am
Platform: Mac + iOS
Location: Melbourne, Australia
Contact:

Thu Feb 17, 2011 7:39 am Post

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.
Complete and utter NOMsense.
Image

User avatar
KB
Site Admin
Posts: 20500
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Thu Feb 17, 2011 10:08 am Post

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:

viewtopic.php?f=3&t=10435

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 :) ).

Thanks!

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
KB
Site Admin
Posts: 20500
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Sat Feb 26, 2011 2:05 pm Post

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:

viewtopic.php?f=17&t=11692
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."