Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2010-03-22 17:01:56 +0000
committerDani Megert2010-03-22 17:01:56 +0000
commitadabfc14b76c4383cd79e612df848a99b8ed1ce4 (patch)
tree28b481f91e5097693a111985c5660ab75ed2619e /org.eclipse.text
parentf3f5fe0af9cb4a5201c5f41500b52ff4e5c69105 (diff)
downloadeclipse.platform.text-adabfc14b76c4383cd79e612df848a99b8ed1ce4.tar.gz
eclipse.platform.text-adabfc14b76c4383cd79e612df848a99b8ed1ce4.tar.xz
eclipse.platform.text-adabfc14b76c4383cd79e612df848a99b8ed1ce4.zip
Committed Anton's patch to fix bug 301023: [projection][typing] "Backspace" key deleting something elsev20100323-0800
Diffstat (limited to 'org.eclipse.text')
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java
index c2341d417..d1c3a0db1 100644
--- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java
+++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Anton Leherbauer <anton.leherbauer@windriver.com> - [projection] "Backspace" key deleting something else - http://bugs.eclipse.org/301023
*******************************************************************************/
package org.eclipse.jface.text.projection;
@@ -405,8 +406,6 @@ public class ProjectionDocument extends AbstractDocument {
if (fragment.getOffset() == offsetInMaster) {
fragment.setOffset(offsetInMaster + lengthInMaster);
fragment.setLength(fragment.getLength() - lengthInMaster);
- } else if (fragment.getOffset() + fragment.getLength() == offsetInMaster + lengthInMaster) {
- fragment.setLength(fragment.getLength() - lengthInMaster);
} else {
// split fragment into three fragments, let position updater remove it
@@ -807,7 +806,7 @@ public class ProjectionDocument extends AbstractDocument {
Position[] segments= getSegments();
for (int i= 0; i < segments.length; i++) {
Segment segment= (Segment) segments[i];
- if (segment.isDeleted() || segment.getLength() == 0) {
+ if (segment.isDeleted() || (segment.getLength() == 0 && i < segments.length - 1)) {
try {
removePosition(fSegmentsCategory, segment);
fMasterDocument.removePosition(fFragmentsCategory, segment.fragment);

Back to the top