wiln / flexlib

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

Highlighter does not properly handle multi-line text results #146

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run the Highlighter example program.
2. Enter "sed quia" into the Highlight TextInput and press Highlight.
3. Notice that in the 'Section 1.10.32 of "de Finibus Bonorum et Malorum",
written by Cicero in 45 BC' section, there is an instance of "sed quia"
that wraps from the second to the third line, where only "quia" on the
third line is highlighted.  The same problem occurs with the Find capability.

NOTE: Word wrap will be inherently influenced by screen resolution, etc. 
If "sed quia" does not wrap from one line to the next for you, just find
any other phrase that does.

What is the expected output? What do you see instead?
Both "sed" and "quia" should be highlighted in the location where the
phrase wraps the the next line, but only "quia" is highlighted.

What version of the product are you using? On what operating system?
Flash Player 9, Firefox 2.0.0.8, Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by tbai...@gmail.com on 18 Jul 2008 at 9:31

GoogleCodeExporter commented 8 years ago
The Highlighter was breaking up when the endIndex would be the end of line 
(EOL). I made small 
modifications to the classes, Highlighter.as and StringBoundaries.as and now it 
seems to be working with a 
little glitch that it adds an extra character at the end.
Also added a function in the Highlighter.as class to enable it to highlight a 
selection of text in a textfield.
Another helpful hint:
To get the textfield out of the TextArea control... look at the code of the 
original author at his demo site:
http://labs.tom-lee.com/Flex/HighlighterDemo/HighlighterDemo.html
Keep Posting...!!
S S Virk

Original comment by virks...@gmail.com on 17 Dec 2008 at 11:06

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by dmcc...@gmail.com on 8 Jan 2009 at 5:39