Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 441927 - [block selection] Rename variable refactoring in block selection let's cursor jump to first line
Summary: [block selection] Rename variable refactoring in block selection let's cursor...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Niraj Modi CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 496686 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-08-17 16:03 EDT by Marcel Bruch CLA
Modified: 2020-07-18 16:18 EDT (History)
6 users (show)

See Also:


Attachments
Partially working patch. (783 bytes, patch)
2015-05-06 04:01 EDT, Niraj Modi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Bruch CLA 2014-08-17 16:03:21 EDT
When I'm in block selection and refactor a variable name the cursor jumps to the first line after entering the first letter.

See the link below for an example video.

http://www.vidup.de/v/SmVkK/

This happens with the Luna SR0.
Comment 1 Dani Megert CLA 2014-08-20 10:55:59 EDT
I think this is a bug in StyledText:

We call StyledText.setCaretOffset(int) this clears the block selection and this sets blockXAnchor = blockYAnchor = -1; As a result the next insertBlockSelectionText(...) call causes the block selection to the first line.
Comment 2 Niraj Modi CLA 2015-05-06 04:01:26 EDT
Created attachment 253205 [details]
Partially working patch.

This bug needs more investigation, moving out of Mars.
Comment 3 Thomas Schulze zur Wiesch CLA 2015-10-13 04:12:29 EDT
Another situation where the issue occurs:
1. switch to block selection
2. type "if("
3. ")" is inserted automatically
4. type "a"
Bug: "a" is inserted in first line; cursor does not scroll into view!

I've set a conditional breakpoint in StyledTest.setCaretOffset() in first line with condition offset == 0 to let the debugger stop in this situation. Unfortunately, I do not understand what happens before and what leads to the issue, but maybe this helps you to debug, too.

Best regards,
Thomas
Comment 4 Niraj Modi CLA 2015-10-30 04:30:55 EDT
(In reply to Thomas Schulze zur Wiesch from comment #3)
> Another situation where the issue occurs:
> 1. switch to block selection
> 2. type "if("
> 3. ")" is inserted automatically
> 4. type "a"
> Bug: "a" is inserted in first line; cursor does not scroll into view!
> 
> I've set a conditional breakpoint in StyledTest.setCaretOffset() in first
> line with condition offset == 0 to let the debugger stop in this situation.
> Unfortunately, I do not understand what happens before and what leads to the
> issue, but maybe this helps you to debug, too.
> 
> Best regards,
> Thomas

Raised separate bug 481085 to trace this issue.
Comment 5 Niraj Modi CLA 2016-05-04 06:04:08 EDT
This bug needs more investigation, moving it out of Neon.
Comment 6 Noopur Gupta CLA 2016-06-24 03:05:59 EDT
*** Bug 496686 has been marked as a duplicate of this bug. ***
Comment 7 Eclipse Genie CLA 2020-07-18 16:18:19 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.