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
IDocument document= fViewer.getDocument();
		document.addPositionCategory(CARET_POSITION);
		document.addPositionUpdater(fgUpdater);
		try {
			if (fFinalCaretOffset != -1)
				document.addPosition(CARET_POSITION, new Position(fFinalCaretOffset));
		} catch (BadLocationException e) {
			openErrorDialog(fViewer.getTextWidget().getShell(), e);
		} catch (BadPositionCategoryException e) {
			JavaPlugin.log(e);
			Assert.isTrue(false);
		}
		fViewer.addTextInputListener(this);
				
		StyledText text= fViewer.getTextWidget();			
		text.addVerifyListener(this);
		text.addVerifyKeyListener(this);
		text.addModifyListener(this);
		text.addPaintListener(this);
		text.showSelection();
		fFramePosition= fManager.getFirstPosition();
		if (fFramePosition == null)
			leave(UNINSTALL | COMMIT | UPDATE_CARET);
	}
	/**
	 * @see LinkedPositionManager.LinkedPositionListener#exit(boolean)
	 */
	public void exit(boolean success) {
		
		leave((success ? COMMIT : 0) | UPDATE_CARET);