Bug 18348 - [misc] TextViewer doesn't scroll correctly
Summary: [misc] TextViewer doesn't scroll correctly
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 35779
Blocks: 17415
  Show dependency tree
 
Reported: 2002-05-30 13:49 EDT by Ryan Cooper CLA
Modified: 2019-09-06 16:13 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.