History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-15024
Type: Bug Bug
Status: Open Open
Assignee: Maxim Shafirov
Reporter: Mark Vedder
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

"Surround With" does not correctly format blocks with a comment as the first line

Created: 16 Sep 07 04:19   Updated: 19 Sep 07 22:01
Component/s: Editor. Editing Text

Build: 7,274
Severity: Medium


 Description  « Hide
Code prior to using Surround With:
public class Foo
{
public void foo()
    {
        //some comment about x
        int x = 1;
        //some comment about y
        int y=1;
    }
}

After highlighting the two comments and two variable declarations:

//some comment about x
int x = 1;
//some comment about y
int y=1;

and performing a "surround with" operation (Ctrl+Alt+T) the resultant code looks like this:

public class Foo
{
    public void foo()
    {
        if (<caret>)
        {
//some comment about x
            int x = 1;
            //some comment about y
            int y=1;
        }
    }
}

The x comment should be indented to match the code it is commenting, not be flush with the margin. That should only happen if the original comment was a commented out line (via a ctrl+Slash). This only seems to be an issue with a comment if it is the first line in the highlighted block.

And since the comment is flush with the left margin, a code reformat does not fix it since the code reformatter treats it as if it was a commented out line of code, leaving it flush with the left margin.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.