Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 314208

Summary: [editor] Editor horizontal scrollbar jumping to the beginning of the line
Product: [WebTools] JSDT Reporter: Jacek Pospychala <jacek.pospychala>
Component: GeneralAssignee: Chris Jaun <cmjaun>
Status: RESOLVED WORKSFORME QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3 CC: cmjaun, daniel, jeroen, vkhomyackov
Version: 3.2   
Target Milestone: 3.5.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
sample.js
none
jumpingscrollbar.avi
none
Simple js file to reproduce editing problem none

Description Jacek Pospychala CLA 2010-05-25 03:54:05 EDT
Using build 3.6M7

Under some circumstances, when editing long line that doesn't fit into window, scrollbar jumps to the start of the line, effectively hiding the cursor.

This happens only on some long lines, not all, and happens shortly after finishing typing. (Maybe is caused by some reconciler?)

Attaching a sample file to reproduce.
Comment 1 Jacek Pospychala CLA 2010-05-25 03:55:58 EDT
Created attachment 169778 [details]
sample.js

to reproduce:
1. open file in editor, make sure it shows up to 45 columns, so horizontal scrollbar shows up
2. put cursor in line 23, and start editing "replace("", "")"
Comment 2 Jacek Pospychala CLA 2010-05-25 03:58:17 EDT
Created attachment 169779 [details]
jumpingscrollbar.avi

how it looks in my editor
Comment 3 Jeroen ter Voorde CLA 2010-06-28 04:47:18 EDT
I can reproduce in 3.2 final (from helios release) using the attached source file (bug.js). Just type a space after one on the long lines with lalalalala in it. When removing the empty block after the block containing the long lines the problem disappears.
Comment 4 Jeroen ter Voorde CLA 2010-06-28 04:48:35 EDT
Created attachment 172870 [details]
Simple js file to reproduce editing problem
Comment 5 Chris Jaun CLA 2011-04-18 16:20:29 EDT
Well...figured out where this is happening:

TextViewer - line 4803
fTextWidget.replaceStyleRanges(region.getOffset(), region.getLength(), ranges);

Though, I have no idea why it is happening. The offset being used is wrong.
Comment 6 Victor Homyakov CLA 2012-04-25 09:15:58 EDT
I observe the similar behavior in JSP editor in two cases:
1. Editing long lines (especially typing JSP comments at the end of line)
2. Opening JSP with search occurrence on long line by double-clicking on search result in Search view.

Eclipse Java EE IDE for Web Developers.
Version: Indigo Service Release 2
Build id: 20120216-1857
Comment 7 Chris Jaun CLA 2013-07-22 10:30:29 EDT
I'm not really sure what fixed this problem, but I can reproduce in 3.5, but not 3.5.1.

The only thing that has gone in is the big performance fix in bug384319, so must have been something in there that cleaned this up.

Checked against the 7/18 build.