Author Topic: C# Beautify  (Read 2494 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
C# Beautify
« on: August 13, 2019, 08:13:55 PM »
#1: When I ran beautify, Slick add 1 space to the end of the line:
Code: [Select]
using System.Reflection;  --- VS Added trailing space.

#2: Object Initializer:
Allow one line code blocks is ON.
Given the 2 lines below, the 2nd one is split onto two lines, but the 1st one correctly stays a single line

Code: [Select]
Cat cat = new Cat { Age = 10, Name = "Fluffy" };
Cat sameCat = new Cat("Fluffy"){ Age = 10 };


#3
#region
Even with all Indent->Preprocessing options turned off, #regions are moved to col 1.


patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: C# Beautify
« Reply #1 on: August 13, 2019, 08:47:00 PM »
#1: I suspect that only happens if the cursor is at or past the end of the line when you run beautify.  That's the only way I can get it to happen, can you verify that's what's happening with you? 

Cursor positions are treated specially so space that might normally be removed during formatting can be left in place to maintain the cursor position. More useful for alias expansions than a batch beautify like this though.  There's probably some special case here, where the trailing space should be converted back to a virtual cursor position.  I'll take a look at it.

#2 Reproduced. I'll look into it.

#3 It doesn't make sense for the PP to be re-indented in that case for C#, I'll take a look at it.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: C# Beautify
« Reply #2 on: August 15, 2019, 08:39:05 PM »
These are fixed for the next beta.