Odd Highlighting Behavior

Hello, I have just begun using Scrivener in my paper-writing workflow. I use LaTeX for final publishing, and I have been playing around various methods of using Scrivener as a frontend. My favorite method so far has been to use various colors of highlighting to denote TeX-commands (e.g., green=citation, pink=argument, etc.). I am very happy with the method, and with Scrivener in general.

However, I have come across a very frustrating and baffling behavior when working with highlights. Here is how I have recreated it:

  1. Create a new project, invoke the highlight hotkeys (using whatever color is default).

  2. Type some text.

  3. Turn off the highlighting.

  4. Go to the next line, type some un-highlighted text. Now, select the text with the cursor, and click on the ‘Help’ menu. Click it again to close it.

  5. Use ESC (or click outside the field) to eliminate the text-selection. On my machine, the selected text will now be highlighted with the previous color, despite not being explicitly highlighted.

— Though the other menus do not seem to invoke the same behavior (i.e., highlighting), I have recreated it by calling up the ‘Other Styles’ menu (from the Ruler), and then killing the menu without selecting anything. The result is the same-- the selected text will be highlighted.

Needless to say, this kind of thing is sort of frustrating. I have done all that I can to ensure that I am not inadvertently triggering the highlights, etc., but if I have made an error please alert me.

Thank you.

—EDIT: I am now having trouble re-creating the bug, after having closed out the program for several hours. This may be a case of user error; if so, I apologize for the post.


No, this isn’t user error, it’s a bug - another user reported it the other day in a different situation (when using the Find panel rather than the Help panel). My guess is that you used the colour panel to assign a custom highlight colour rather than using a preset colour; this is the problem. The colour panel is hardwired into the OS X text system only to affect for text colour, so it has taken a lot of hooking into the text system and intercepting the different colour calls for it to work with the highlight colour too; I had missed a bit of code in one of the places that get intercepted. Basically, whenever the a window gets the focus, the colour panel will set its colour from the currently selected text colour, which in turn tells the text to set its colour (which normally doesn’t matter as they are the same). I had intercepted this to set the colour panel’s colour to the highlight colour, but had forgot to tell the text to ignore the -setColor command when the colour in the colour panel changed… In other words, two lines of code fixed it… After hours of looking for what was going wrong!

Hmm, that’s a lot more than you needed to know! Anyway, suffice to say that it is fixed for the next update. So long as you close the colour panel whenever you’ve finished highlighting, it should be okay for now as a workaround (I think).

All the best,