Bug 564622 - Deindent (Shift+Tab) doesn't always work on selected Single Line comments
Summary: Deindent (Shift+Tab) doesn't always work on selected Single Line comments
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.15   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-24 10:04 EDT by Titouan Vervack CLA
Modified: 2020-06-24 10:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Titouan Vervack CLA 2020-06-24 10:04:52 EDT
Sometimes comments are not deindented when pressing shift tab

For the following code:
* Ctrl+A
* Shift+tab
* Notice how the first comment is not deindented

public class A {
	// Why no deindent?
	public int a;
	// hey
	/*
	 * no hey
	 */
}

Having ran this through a debugger the error appears to surface in org.eclipse.jface.text.TextViewer.shift(boolean, boolean, boolean).

The issue here is that the startline that's being calculated for the first SL comment is 2 instead of 1, the endline is 1 as it should be.

P.S.: Since this appears to be a JFace bug I'm not sure I'm reporting this in the correct place.