Bug 569550 - Rendering code-mining / line spacing should keep caret position unchanged.
Summary: Rendering code-mining / line spacing should keep caret position unchanged.
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.19   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.19 M1   Edit
Assignee: Mickael Istria CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 553849 569124
  Show dependency tree
 
Reported: 2020-12-08 09:29 EST by Mickael Istria CLA
Modified: 2020-12-11 12:09 EST (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 Mickael Istria CLA 2020-12-08 09:29:50 EST
When increasing the line height for code mining, the text area should be changed so that the caret and the current line remain at the same location. Basically, the visible area should be shifted/scrolled getLineHeight() pixels down if possible
Comment 1 Sarika Sinha CLA 2020-12-08 10:48:37 EST
(In reply to Mickael Istria from comment #0)
> When increasing the line height for code mining, the text area should be
> changed so that the caret and the current line remain at the same location.
> Basically, the visible area should be shifted/scrolled getLineHeight()
> pixels down if possible

Did not understand exactly what do you mean by shifting getLineHeight() pixels down ?
Comment 2 Mickael Istria CLA 2020-12-08 10:52:02 EST
(In reply to Sarika Sinha from comment #1)
> Did not understand exactly what do you mean by shifting getLineHeight()
> pixels down ?

Yes, I think I poorly explained it.
The idea is that we try to get the caret position fixed. So when we are in a scrollable editor and a code mining is added above the current line, we change the area by y+=lineHeight (shift lineHeight pixels down), so the final caret position is not modified, nor is the current line. Things move "around" the current line, not on the current line.
And similarly, when removing a code mining, we draw change the area to be the right amounst of pixels "higher" so the current line and caret are not perceived as moving.
Comment 3 Eclipse Genie CLA 2020-12-08 15:15:46 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/173561
Comment 4 Mickael Istria CLA 2020-12-09 17:15:25 EST
This is probably more something to handle at SWT level, when invoking StyledText.setLineVerticalIndent.
Comment 6 Mickael Istria CLA 2020-12-11 09:11:11 EST
Founds some cases where patch isn't working as expected.
Comment 7 Eclipse Genie CLA 2020-12-11 11:52:09 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/173710