Bug 10247 Template - code assist ends template editing
Build > 20020214.1 Create the following class import java.util.List; public class T { public List getList() { return null; } public void foo() { T t= null; for <= code assist } } - select for - iterate over collection - press tab - type t.get <= code assist - select getList observe: template editing gets ended.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
Position[] positions= document.getPositions(CARET_POSITION);
				if ((positions != null) && (positions.length != 0)) {
					int offset= positions[0].getOffset() - region.getOffset();		
					if ((offset >= 0) && (offset <= region.getLength()))
						text.setSelection(offset, offset);
				}
			}
			document.removePositionUpdater(fgUpdater);
			document.removePositionCategory(CARET_POSITION);
			
			if (fExitListener != null)
				fExitListener.exit(
					((flags & COMMIT) != 0) ||
					((flags & DOCUMENT_CHANGED) != 0));
		} catch (BadPositionCategoryException e) {
			JavaPlugin.log(e);
			Assert.isTrue(false);
		}
		if ((flags & DOCUMENT_CHANGED) == 0)
			text.redraw();
	}
	private void next() {
		redrawRegion();
		
		fFramePosition= fManager.getNextPosition(fFramePosition.getOffset());
		if (fFramePosition == null) {
			leave(UNINSTALL | COMMIT | UPDATE_CARET);
		} else {
			selectRegion();
			redrawRegion();