Bug 43489 Conflicts between "Segmented Java Editor" and "Correct Indentation"
I20030917 + plugin export for smoke test Correct Indentation (Ctrl+I) causes problems in segmented java editor (Toolbar > click "Show Source of selected element only"). - org.junit as source - open TestCase.java - enable "Show Source of selected element only" - select method "run()" in outline - set cursor to 1:1 - Ctrl+I -> whole type becomes visible in editor - select method "run()" in outline again - manually mangle indentation by insterting/deleting tabs - Ctrl+A, Ctrl+I -> whole type becomes visible in editor - Ctrl+Z (Undo) -> the undo TextEdits are applied to the wrong offset and destroy +/- arbitrary parts of my source!
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/IndentAction.java
document.addPosition(end);
				firstLine= document.getLineOfOffset(offset);
				
				int minusOne= length == 0 ? 0 : 1;
				nLines= document.getLineOfOffset(offset + length - minusOne) - firstLine + 1;
			} catch (BadLocationException e) {
				
				JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK, null, e));
				return;
			}
			
			Runnable runnable= new Runnable() {
				public void run() {
					IRewriteTarget target= (IRewriteTarget)getTextEditor().getAdapter(IRewriteTarget.class);
					if (target != null) {
						target.beginCompoundChange();
						target.setRedraw(false);
					}
					
					try {
						JavaHeuristicScanner scanner= new JavaHeuristicScanner(document);
						JavaIndenter indenter= new JavaIndenter(document, scanner);
						boolean hasChanged= false;
						for (int i= 0; i < nLines; i++) {
							hasChanged |= indentLine(document, firstLine + i, offset, indenter, scanner);
						}
						
						
						
						int newOffset= fCaretOffset;