Author Topic: C# Beautify  (Read 1359 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1960
  • Hero Points: 185
  • 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: 1310
  • Hero Points: 121
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: 1310
  • Hero Points: 121
Re: C# Beautify
« Reply #2 on: August 15, 2019, 08:39:05 pm »
These are fixed for the next beta.