Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2019-11-26 08:53:30 +0000
committerPaul Pazderski2019-11-26 09:12:10 +0000
commit190a17ee7926597a57f3f99788c9910235eebc4d (patch)
tree58afb50d53a14e9e2f750514ed18754abe052ea6
parent2048c0e37525189f7ae0760944e56d90339758e6 (diff)
downloadeclipse.platform.debug-R4_14_maintenance.tar.gz
eclipse.platform.debug-R4_14_maintenance.tar.xz
eclipse.platform.debug-R4_14_maintenance.zip
Change-Id: If5bc348ffc127ac097b34e25a6a835e9891c11ee Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java2
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java11
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java4
3 files changed, 13 insertions, 4 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java
index 843717248..c808df695 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java
@@ -321,8 +321,8 @@ public class IOConsole extends TextConsole {
}
final IDocument document = partitioner.getDocument();
- document.setDocumentPartitioner(null);
partitioner.disconnect();
+ document.setDocumentPartitioner(null);
super.dispose();
}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
index 3c35cb4ff..2e4187125 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
@@ -32,6 +32,7 @@ import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentAdapter;
import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.IPositionUpdater;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.JFaceTextUtil;
@@ -376,9 +377,13 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
int offset = event.lineOffset;
int length = event.lineText.length();
- StyleRange[] partitionerStyles = ((IConsoleDocumentPartitioner) document.getDocumentPartitioner()).getStyleRanges(offset, length);
- if (partitionerStyles != null) {
- Collections.addAll(ranges, partitionerStyles);
+ IDocumentPartitioner partitioner = document.getDocumentPartitioner();
+ if (partitioner instanceof IConsoleDocumentPartitioner) {
+ StyleRange[] partitionerStyles = ((IConsoleDocumentPartitioner) partitioner).getStyleRanges(offset,
+ length);
+ if (partitionerStyles != null) {
+ Collections.addAll(ranges, partitionerStyles);
+ }
}
try {
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java
index 609c9f1bb..7d977066a 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java
@@ -98,6 +98,10 @@ public class IOConsoleViewer extends TextConsoleViewer {
protected void handleVerifyEvent(VerifyEvent e) {
final IConsoleDocumentPartitioner partitioner = (IConsoleDocumentPartitioner) getDocument()
.getDocumentPartitioner();
+ if (partitioner == null) {
+ e.doit = false;
+ return;
+ }
final IConsoleDocumentPartitionerExtension partitionerExt = (IConsoleDocumentPartitionerExtension) partitioner;
final StyledTextContent content = getTextWidget().getContent();

Back to the top