tuliob / jsyntaxpane

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

SyntaxDocument doesn't work with DocumentFilter #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Add a document filter to the SyntaxDocument.  For example in
SyntaxTester.jCmbLangsItemStateChanged after you set the EditorKit:

((SyntaxDocument) jEdtTest.getDocument()).setDocumentFilter(new
DocumentFilter());

2. Launch the SyntaxTester and start editing.  The syntax highlighting
won't update as you type.

What is the expected output? What do you see instead?

Expect SyntaxDocument.parse() to get called, but SyntaxDocument doesn't
override AbstractDocument.replace() (which is called by the
DocumentFilter's FilterBypass).  So it goes around the SyntaxDocument, and
the highlight doesn't update.

What version of the product are you using? On what operating system?

JSyntaxPane-08071 source, Windows XP

Thanks!

Original issue reported on code.google.com by javlo...@gmail.com on 31 Jul 2008 at 11:00

GoogleCodeExporter commented 9 years ago
Fix under investigation and test.   Will be part of next release, in a week 
time.

Original comment by ayman.al...@gmail.com on 31 Jul 2008 at 1:39

GoogleCodeExporter commented 9 years ago

Original comment by ayman.al...@gmail.com on 31 Jul 2008 at 1:41

GoogleCodeExporter commented 9 years ago
Did not have time to work on this.  Still no PC to work on :(
Fix should be fairly easy.  Just override the replace method of the 
SyntaxDocument,
call super method, then parse.
I'd appreciate if you can work on this one too.
When this is also fixed, we can release the 0.9.0

Original comment by ayman.al...@gmail.com on 8 Aug 2008 at 9:09

GoogleCodeExporter commented 9 years ago
It's been fixed in my local copy :)  

@Override
public void replace(int offset, int length, String text, AttributeSet attrs) 
throws
BadLocationException {
    super.replace(offset, length, text, attrs);
    parse();
}

Original comment by javlo...@gmail.com on 8 Aug 2008 at 9:24

GoogleCodeExporter commented 9 years ago
Rev.15 has this change. @javlopez can you verify this?

Original comment by subwiz on 8 Aug 2008 at 5:44

GoogleCodeExporter commented 9 years ago
yup it's fixed

Original comment by javlo...@gmail.com on 9 Aug 2008 at 3:57