Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321189 - Editor scrolls horizontally unprompted when code folding is enabled with long lines
Summary: Editor scrolls horizontally unprompted when code folding is enabled with long...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 7.0   Edit
Hardware: PC Windows XP
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-29 03:46 EDT by Cameron Miller CLA
Modified: 2022-08-06 04:19 EDT (History)
8 users (show)

See Also:


Attachments
screenshot "before" editing long line (18.83 KB, image/png)
2010-09-15 19:43 EDT, Cameron Miller CLA
no flags Details
screenshot "after" editing long line (31.33 KB, image/png)
2010-09-15 19:43 EDT, Cameron Miller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron Miller CLA 2010-07-29 03:46:15 EDT
Build Identifier: 20100218-1602

When editing a long line where you had to scroll to the right.
And then you put the cursor to the left of where you edited (using a mouse click) or attempt to select text that is to the left of the edited text.
For some reason the editor unwantedly and unexpectedly scrolls horizontally.

It seems that this only happens when code folding is enabled.

There are other issues which I think are side effects of enabling code folding that I'm still trying to get steps to reproduce:
- I've also noticed that Eclispse steals focus from other applications (when you save, and then quickly switch to another app where file has > 10000 lines)
- When adding a #ifdef/#else/#endif guard sometimes the code folding buttons (in the margin aren't rendered, but you can still click on them)


Reproducible: Always

Steps to Reproduce:
1. Enable code folding (if not already enabled)
2. open a file with long lines (i.e. the line is wider than the window and requires horizontal scrolling to view the end of the line)
3. scroll to the right
4. enter text at the end of the line (or somewhere near the end)
5. use the mouse and click somewhere to the left side of the new text
6. the editor incorrectly scrolls the editor to the left
Comment 1 Anton Leherbauer CLA 2010-08-24 04:13:54 EDT
This seems to work for me.  Could you attach a screen shot showing the problem?
Comment 2 Cameron Miller CLA 2010-09-15 19:43:01 EDT
Created attachment 178991 [details]
screenshot "before" editing long line
Comment 3 Cameron Miller CLA 2010-09-15 19:43:40 EDT
Created attachment 178992 [details]
screenshot "after" editing long line
Comment 4 Cameron Miller CLA 2010-09-15 19:51:24 EDT
I've attached two images. It turns out that you don't even have to mouse click to the left of the edited text. 
Here is a description of the sequence of images:
In the first one "before", I have scrolled horizontally to the right and I am about to remove a typo (delete the 'X').
I then press delete key and if I wait a second (I don't do anything after pressing delete).
Eclipse incorrectly, automatically scrolls left (to the zero column).
Note that code folding is active.

I have since found that this bug is not reproducible in all cases (sorry for misleading info), but once you find a file where it does happen, it always happens for that line in the file (even after closing and reopening the file) - although I haven't tested restarting eclipse.

It also seems to happen regardless of the type of edit you make to the line (e.g. delete, insert, paste all seem to make it happen).
Comment 5 Cameron Miller CLA 2010-09-15 19:54:56 EDT
(In reply to comment #4)
> Eclipse incorrectly, automatically scrolls left (to the zero column).
> Note that code folding is active.
> 
> I have since found that this bug is not reproducible in all cases (sorry for
> misleading info), but once you find a file where it does happen, it always
> happens for that line in the file (even after closing and reopening the file) -
> although I haven't tested restarting eclipse.
> 
> It also seems to happen regardless of the type of edit you make to the line
> (e.g. delete, insert, paste all seem to make it happen).

If I disable code folding (for new editors) and reopen the file, the problem goes away
Comment 6 Anton Leherbauer CLA 2010-09-23 07:33:58 EDT
I could not reproduce so far.
Does this only happen with lines inside an #ifdef/#ifndef/#if?
The file seems to be quite large.  Does it happen with small files, too?
Comment 7 Hans CLA 2010-10-11 17:39:52 EDT
This also happens to me on WinXP, Helios SR 1, Build id: 20100917-0705 using the PHP section (haven't tried it in alternate ones).  To duplicate:


1) On a long line, scroll right
2) Set the cursor anywhere on the line
3) Type in something
4) Wait a second
5) Editor horizontally scrolls all the way left


If it doesn't occur when you first do it, try using the backspace one or two characters.


I can send a video of it occurring, if you'd like.
Comment 8 Anton Leherbauer CLA 2010-10-12 02:25:30 EDT
(In reply to comment #7)
> This also happens to me on WinXP, Helios SR 1, Build id: 20100917-0705 using
> the PHP section (haven't tried it in alternate ones).  To duplicate:

What do you mean by "PHP section"?
Comment 9 Hans CLA 2010-10-12 11:12:42 EDT
I mean that I'm using Eclipse for PHP Developers.
Comment 10 Emil CLA 2011-11-11 10:11:14 EST
I use Eclipse for C/C++ developers. When I edit long lines with code folding enabled and pause writing for half a second, Eclipse scrolls horizontally. Very annoying. In Windows and Ubuntu.
Comment 11 Nathan Ridge CLA 2015-12-01 17:47:09 EST
I can reproduce this problem, when the next line after the line you're editing begins a branch that is a folded. 

Bug 461122 is similar, they may have the same cause.
Comment 12 Cédric Catoliquot CLA 2021-09-02 11:09:22 EDT
This bug is very boring, and still "NEW" ?

Good Lord...

With this bug working with Cucumber feature file is a mess.

Version: 2021-06 (4.20.0)
Build id: 20210612-2011
Cucumber Eclipse: 1.0.0.202012131300