Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEtienne Reichenbach2018-07-13 10:15:46 -0400
committerEtienne Reichenbach2018-07-18 09:54:48 -0400
commit982b689404fbe86e68a1a36dd5460d4183fe9097 (patch)
tree8ad536a69e3c3e068fd54b4f51a16a58b20d4642 /org.eclipse.text
parent70121cc291f51eed06c87255a67b5dd2c61d64b7 (diff)
downloadeclipse.platform.text-982b689404fbe86e68a1a36dd5460d4183fe9097.tar.gz
eclipse.platform.text-982b689404fbe86e68a1a36dd5460d4183fe9097.tar.xz
eclipse.platform.text-982b689404fbe86e68a1a36dd5460d4183fe9097.zip
Bug 536952 - Avoid QuickDiff re-enabling in DocumentRewriteSessionEvent
* Only resume the DocumentLineDiffer if if was previously suspended by a DocumentRewriteSessionEvent. * Add a null check at AbstractDocument.stopRewriteSession(DocumentRewriteSession) to avoid a NullPointerException if startRewriteSession is not called before calling stopRewriteSession. The javadoc of stopRewriteSession says "This method has only any effect if startRewriteSession has been called before.", without the null-check the method had an effect if startRewriteSession was not called before, namely an NPE. Change-Id: Ia6f92c686c934e1c7cbb514e2c32ac055b557935 Signed-off-by: Etienne Reichenbach <etienner@gmail.com>
Diffstat (limited to 'org.eclipse.text')
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
index b4390a743..0e5a865e5 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
@@ -1497,7 +1497,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension,
@Override
public void stopRewriteSession(DocumentRewriteSession session) {
- if (fDocumentRewriteSession == session) {
+ if (fDocumentRewriteSession != null && fDocumentRewriteSession == session) {
if (DEBUG)
System.out.println("AbstractDocument: Stopping rewrite session: " + session); //$NON-NLS-1$

Back to the top