Bug 4360 Template - cursor at wrong position
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateEditorPopup.java
public void focusLost(FocusEvent e) {
		EditBox box= getEditBox(e);
		box.getText().removeModifyListener(this);
		box.getText().removeVerifyKeyListener(this);
		
		box.unselect();
	}
	
	private void updatePosition() {
		if ((fShell == null) || fShell.isDisposed())
			return;
		
		StyledText text= fContext.getViewer().getTextWidget();
		Point location= text.getLocationAtOffset(fContext.getStart());
		location= text.toDisplay(location);
		
		
		location.x -= BORDER_WIDTH; 
		location.y -= BORDER_WIDTH;
		Point size= fShell.getSize();
		Display display= fShell.getDisplay();
		Rectangle rectangle= display.getBounds();
				
		if (location.x > rectangle.width - size.x)
			location.x = rectangle.width - size.x;
		if (location.y > rectangle.height - size.y)
			location.y = rectangle.height - size.y;
		
		fShell.setLocation(location.x, location.y);	
	}