1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 18:05:33 +02:00

2.0 cleanup

This commit is contained in:
Sebastien Marineau 2002-08-09 02:31:39 +00:00
parent 324f4bf5dd
commit 958906d808

View file

@ -12,7 +12,7 @@ import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.TextPresentation;
import org.eclipse.jface.text.presentation.IPresentationReconciler;
import org.eclipse.jface.text.presentation.PresentationReconciler;
import org.eclipse.jface.text.rules.RuleBasedDamagerRepairer;
import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.swt.custom.StyleRange;
@ -45,26 +45,13 @@ public class AsmSourceViewerConfiguration extends SourceViewerConfiguration {
RuleBasedDamagerRepairer dr= new RuleBasedDamagerRepairer(
/*
* Override addRange in the default RuleBasedDamagerRepairer, it forgets to pass in text style
* More code here only until we move to 2.0...
*/
fTextTools.getCodeScanner(),
new TextAttribute(manager.getColor(ICColorConstants.C_DEFAULT))) {
protected void addRange(TextPresentation presentation, int offset, int length, TextAttribute attr) {
presentation.addStyleRange(new StyleRange(offset, length, attr.getForeground(), attr.getBackground(), attr.getStyle()));
}
};
DefaultDamagerRepairer dr= new DefaultDamagerRepairer(fTextTools.getCodeScanner());
reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
dr= new RuleBasedDamagerRepairer(
null,
new TextAttribute(manager.getColor(ICColorConstants.C_MULTI_LINE_COMMENT))
);
dr= new DefaultDamagerRepairer(fTextTools.getCodeScanner());
reconciler.setDamager(dr, AsmPartitionScanner.C_MULTILINE_COMMENT);
reconciler.setRepairer(dr, AsmPartitionScanner.C_MULTILINE_COMMENT);