Bug 52476 [painting] redraw behavior
build M7 Annotated method AnnotationPainter.handleDrawRequest with a repaint counter. 1) Open TestCase.java 2) add line >String s= < to tearDown method, set caret at end of line 3) spell checking enabled, otherwise default settings 3) type a single space -> 1 immediate repaint, 3 after timeout 4) type " -> auto inserted closing " + linked mode -> 10 immediate repaints, 3 after timeout
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedUIControl.java
Assert.isNotNull(fCurrentTarget);
		ITextViewer viewer= fCurrentTarget.getViewer();
		Assert.isNotNull(viewer);
		fCurrentTarget.fWidget= viewer.getTextWidget();
		if (fCurrentTarget.fWidget == null)
			leave(ILinkedListener.EXIT_ALL);
		if (fCurrentTarget.fKeyListener == null) {
			fCurrentTarget.fKeyListener= new LinkedUIKeyListener();
			((ITextViewerExtension) viewer).prependVerifyKeyListener(fCurrentTarget.fKeyListener);
		} else
			fCurrentTarget.fKeyListener.setEnabled(true);
		
		((IPostSelectionProvider) viewer).addPostSelectionChangedListener(fSelectionListener);
		if (viewer instanceof ISourceViewer) {
			ISourceViewer sv= (ISourceViewer) viewer;
			IAnnotationModel model= sv.getAnnotationModel();
			if (model instanceof IAnnotationModelExtension) {
				IAnnotationModelExtension ext= (IAnnotationModelExtension) model;
				IAnnotationModel ourModel= ext.getAnnotationModel(getUniqueKey());
				if (ourModel == null) {
					LinkedPositionAnnotations lpa= new LinkedPositionAnnotations();
					lpa.setTargets(fIterator.getPositions());
					lpa.setExitTarget(fExitPosition);
					ext.addAnnotationModel(getUniqueKey(), lpa);
					fCurrentTarget.fAnnotationModel= lpa;
				}
			}
		}
		fCurrentTarget.fWidget.showSelection();
		fCurrentTarget.fWidget.addVerifyListener(fCaretListener);