Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] CEditor, changes?

Try this. There was an out of range exception happening when rescans were done at a non-zero offset because the length being requested was too large. This should work in 2.0 and 2.1 though I've only tested it on 2.0.1 so far.

At some point, someone should go through the code and exterminate anywhere exceptions are caught but nothing is done with them. At least a message should be written to the plugin error log.

Index: BufferedDocumentScanner.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/BufferedDocumentScanner.java,v
retrieving revision 1.4
diff -u -r1.4 BufferedDocumentScanner.java
--- BufferedDocumentScanner.java	11 Dec 2002 15:37:31 -0000	1.4
+++ BufferedDocumentScanner.java	3 Jan 2003 15:37:34 -0000
@@ -85,8 +85,8 @@
         fRangeLength= length;
         
         // Clamp at end of the real document
-        if (fRangeLength > fDocument.getLength())
-           fRangeLength = fDocument.getLength();
+        if (fRangeLength + fRangeOffset > fDocument.getLength())
+           fRangeLength = fDocument.getLength() - fRangeOffset;
 
         String[] delimiters= document.getLegalLineDelimiters();
         fDelimiters= new char[delimiters.length][];


> -----Original Message-----
> From: Alain Magloire [mailto:alain@xxxxxxx] 
> Sent: Friday, January 03, 2003 9:26 AM
> To: cdt-dev@xxxxxxxxxxx
> Subject: Re: [cdt-dev] CEditor, changes?
> 
> 
> > 
> > I haven't noticed any breakage of syntax hilight, could you 
> forward the =
> > bug number? I recommend that the hilight be fixed and the 
> 2.1 fix be =
> 
> The patch you submitted, works fine with the 2.1 snapshots.
> It does not work well with the 2.0.x series, #28968, 
> describes the problem.
> 
> > left in because many people want it.
> 
> It is still in the head.  I'm currently busy looking at other things
> but if you have a fix, it is welcome.  If not, I would recommand we
> fallback to the previous code(int the branch only), since 
> 1.0.1 was couple
> to 2.0.x platform.
> 
> The question now is when to move ahead with the 2.1 series 
> making CDT commited
> to 2.1 only.  It is probably not possible in the long term to 
> try to be
> compatible with both, 2.0.x and 2.1.
> 
> 
> > Also, I don't see the 'snapshots of =
> > the head' builds on the normal download page, where are 
> they? The latest =
> > I see is a nightly 12/30 build that says it's for Eclipse 2.0.x.
> 
> The build mechanisms,(nigthly, integration, stable, etc ...) are not
> quite in place yet, I understand there are a lot of logistics 
> problems.
> 


Back to the top