jlaso / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

SyntaxView.drawSelectedText calls super.drawUnselectedText #160

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use jsyntaxpane in a JEditorPane
2. Call setSelectedTextColor() on the JEditorPane
3. Type some text
4. Select it

What is the expected output?
A piece of text with the selected text color.

What do you see instead?
A piece of text with the unselected text color.

What version of the product are you using? On what operating system?
0.9.4 on Mac OS X, but the same code seems to be used in trunk:

http://code.google.com/p/jsyntaxpane/source/browse/trunk/src/main/java/jsyntaxpa
ne/SyntaxView.java#142

Original issue reported on code.google.com by r.zwe...@gmail.com on 19 Jul 2010 at 1:46

GoogleCodeExporter commented 9 years ago
That's actually a feature, not a bug ;-)
My personal preference is to have selection highlight the background only, and 
keep the syntax aware foreground colors.  So the method draw selected text 
calls draw of the unselected text but just highlights the background first.
For the normal single color selection, you need to configure the property 
"SingleColorSelect" in one of the config files.  
If that property is true (default is false), then normal single color selection 
will be used.
But as you rightfully say, there is a bug and it will be fixed very soon.

Original comment by ayman.al...@gmail.com on 21 Jul 2010 at 7:22

GoogleCodeExporter commented 9 years ago
Thanks for your reply. I agree that with the highlighting on, you probably want 
the drawUnselectedText.
With highlighting off (e.g., SingleColorSelect=true) I'd prefer 
drawSelectedText, it's up to the developer to pick the right color then.

Original comment by r.zwe...@gmail.com on 21 Jul 2010 at 8:04

GoogleCodeExporter commented 9 years ago
This should be fixed in branch 0.9.6 r144 now.

Original comment by ayman.al...@gmail.com on 21 Jul 2010 at 9:06