5

In VS 2012 and earlier i was able to press CTRL+K, CTRL+D which would change

<div>

   <div>

      <asp:TextBox runat="server" Id="Textbox1"></asp:/TextBox>

   </div>
</div>

to

<div>
   <div>
      <asp:TextBox runat="server" Id="Textbox1"></asp:/TextBox>
   </div>
</div>

So it would remove the extra lines. In VS 2013 when i do the same it doesn't format it correctly (or in the way i prefer).

I've looked under Tools but nothing that i can see that would sort the issue, i also have Productivity Power Tools installed and again no option to remove the extra lines.

Anyway around this?

Edit 1

using \n\n and \n Search

8
  • For a workaround replace \n\n with \n Commented Mar 7, 2015 at 10:12
  • I hit Ctrl-H enter \n\n and \n in the bottom box = "The following specified text was not found: \n\n"
    – Computer
    Commented Mar 7, 2015 at 10:16
  • For \n to be interpreted as newline you must enable regular expressions in search box. Commented Mar 7, 2015 at 10:21
  • Just make sure to disable it afterwards, because it may confuse you in some future search. Commented Mar 7, 2015 at 10:24
  • Strange i think im doing this correctly but nothing happens (See Edit 1 in my original post of what im doing)
    – Computer
    Commented Mar 7, 2015 at 10:41

1 Answer 1

1

Under Windows, line endings are \r\n. To search for blank lines, search for ^\r\n with regular expressions on and replace with a blank string.

enter image description here

Note: the Replace... shown is an empty string placeholder.

Not the answer you're looking for? Browse other questions tagged or ask your own question.