Bug 18348

Summary: [misc] TextViewer doesn't scroll correctly
Product: [Eclipse Project] Platform Reporter: Ryan Cooper <ryan_cooper>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P5 CC: daniel_megert, n.a.edgar
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on: 35779    
Bug Blocks: 17415    

Description Ryan Cooper CLA 2002-05-30 13:49:11 EDT
In TextViewer.getVisibleLinesInViewer(), the number of lines returned is 
incorrect if some lines are longer than the viewer width, and the viewer has 
style SWT.WRAP. This causes TextViewer.internalRevealRange(int, int) to work in 
an unexpected way if the viewer is not wide enough to display full lines of 
text in the document.

If that is the case, calling internalRevealRange(doc.get().length-1, 1) will 
not necessarily scroll to the bottom of the document.
Comment 1 Nick Edgar CLA 2002-05-30 14:41:48 EDT
This is needed to get scrolling to work correctly in the External Tools / Ant 
console.
Comment 2 Kai-Uwe Maetzel CLA 2002-05-30 15:15:22 EDT
TextViewer and subclasses do not provide support for SWT.WRAP. This will not 
change for 2.0. Updated JavaDoc accordingly. Propose to either remove SWT.WRAP
or to use dedicated method for revealing the end of the document:

	protected void revealEndOfDocument() {
		IDocument doc= getDocument();
		int docLength= doc.getLength();
		if (docLength > 0) {
			StyledText widget= getTextWidget();
			widget.setCaretOffset(docLength);
			widget.showSelection();
		}
	}
Comment 3 Dani Megert CLA 2007-06-22 09:58:57 EDT
Get rid of deprecated state.
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:13:43 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.