From eabf8400b2c01370d133923bc8adc340a8b55168 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Fri, 20 Aug 2010 08:21:32 +0000 Subject: [PATCH] Bug 323206 - [Code templates] Pop up error when using code formatter option and ${line_selection} --- .../internal/corext/template/c/ExclusivePositionUpdater.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/ExclusivePositionUpdater.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/ExclusivePositionUpdater.java index 9a079c9644c..758f6eb3f6d 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/ExclusivePositionUpdater.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/template/c/ExclusivePositionUpdater.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. + * Copyright (c) 2006, 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 @@ -77,7 +77,7 @@ final class ExclusivePositionUpdater implements IPositionUpdater { // offset becomes end of event, length adjusted accordingly int newOffset= eventOffset + eventNewLength; position.setOffset(newOffset); - position.setLength(end - newOffset); + position.setLength(end - newOffset + deltaLength); } else { // event consumes the position - delete it position.delete();