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:
parent
324f4bf5dd
commit
958906d808
1 changed files with 3 additions and 16 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue