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
IDocument doc= fTargets[i].getViewer().getDocument();
			if (doc != null) {
				doc.removePositionUpdater(fPositionUpdater);
				boolean uninstallCat= false;
				String[] cats= doc.getPositionCategories();
				for (int j= 0; j < cats.length; j++) {
					if (getCategory().equals(cats[j])) {
						uninstallCat= true;
						break;
					}
				}
				if (uninstallCat)
					try {
						doc.removePositionCategory(getCategory());
					} catch (BadPositionCategoryException e) {
						
					}
			}
		}
		fEnvironment.exit(flags);
	}
	/**
	 * Returns the currently selected region or <code>null</code>.
	 * 
	 * @return the currently selected region or <code>null</code>
	 */
	public IRegion getSelectedRegion() {
		if (fFramePosition == null)
			if (fExitPosition != null)
				return new Region(fExitPosition.getOffset(), fExitPosition.getLength());