Bug 564622

Summary: Deindent (Shift+Tab) doesn't always work on selected Single Line comments
Product: [Eclipse Project] Platform Reporter: Titouan Vervack <titouan.vervack>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.15   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

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.